In LINQ, IEnumerable
and IQueryable
are used for evaluating queries against a specific database or collection. IQueryable
implements IEnumerable
.
IEnumerable
IEnumerable
resides in System.Collections
.
It retrieves data from a data source, loads it on the client-server, and then filters it.
It is more suitable for collections like arrays, lists, etc.
It supports deferred executions; i.e., unnecessary query executions are avoided.
IQueryable
IQueryable
resides in System.Linq
.
It retrieves the data from a data source on the client-server after filtering it.
It is more suitable for remote data sources.
It supports deferred executions;i.e., unnecessary query executions are avoided.
Free Resources