The performance implications of IEnumerable vs. IQueryable

Posted on Dot net Slackers See other posts from Dot net Slackers
Published on Tue, 06 Apr 2010 00:00:00 GMT Indexed on 2010/04/06 6:53 UTC
Read the original article Hit count: 290

Filed under:
It all started innocently enough. I was implementing a "Older Posts/Newer Posts" feature for my new web site and was writing code like this:IEnumerable<Post> FilterByCategory(IEnumerable<Post> posts, string category) {  if( !string.IsNullOrEmpty(category) ) { return posts.Where(p => p.Category.Contains(category)); }}...  var posts = FilterByCategory(db.Posts, category);  int count = posts.Count();... The "db" was an EF object context object, but it could just as...

Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.



Email this Article

© Dot net Slackers or respective owner

The performance implications of IEnumerable vs. IQueryable

Posted on Dot net Slackers See other posts from Dot net Slackers
Published on Tue, 06 Apr 2010 00:00:00 GMT Indexed on 2010/04/06 6:53 UTC
Read the original article Hit count: 290

Filed under:
It all started innocently enough. I was implementing a "Older Posts/Newer Posts" feature for my new web site and was writing code like this:IEnumerable<Post> FilterByCategory(IEnumerable<Post> posts, string category) {  if( !string.IsNullOrEmpty(category) ) { return posts.Where(p => p.Category.Contains(category)); }}...  var posts = FilterByCategory(db.Posts, category);  int count = posts.Count();... The "db" was an EF object context object, but it could just as...

Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.



Email this Article

© Dot net Slackers or respective owner