IEnumerable Vs IQueryable Many developers gets confused between IEnumerable and IQueryable. When it comes to writing code, both looks very similar. However there are many difference between them which needs to be taken care of while writing code. Both have some intended usability scenarios for which they are made. Below lists the differences between them based on their properties : IEnumerable IQueryable Namespace System.Collections Namespace System.Linq Namespace Derives from No base interface Derives from IEnumerable Deferred Execution Supported Supported Lazy Loading Not Supported Supported How does it work While querying data from database, IEnumerable execute select query on server side, load data in-memory on client side and then filter data. Hence does more work and becomes slow. While querying data from database, IQueryable execute select query on server side with all filters. Hence does less work and becomes fast. Suitable for ...
C#, OOPS, MVC, WCF, Architecture, SQL, Table, Triggers, Script and SQL Server