Returning IEnumerable<T> vs IQueryable<T>

Posted by stackoverflowuser on Stack Overflow See other posts from Stack Overflow or by stackoverflowuser
Published on 2010-05-20T18:13:59Z Indexed on 2010/05/20 18:20 UTC
Read the original article Hit count: 299

Filed under:
|
|
|

what is the difference between returning iqueryable vs ienumerable.

IQueryable<Customer> custs = from c in db.Customers
where c.City == "<City>"
select c;

IEnumerable<Customer> custs = from c in db.Customers
where c.City == "<City>"
select c;

Will both be deferred execution? When should one be preferred over the other?

© Stack Overflow or respective owner

Related posts about c#

Related posts about LINQ