Description:I have searched few differences between IEnumerable<T> and IQueryable<T> but still can't decide which one to preferred and why, anyone with an simple example would be more appreciated so that i can understand it with more clarity.
Posted by: Junaid Aziz | Posted on: Nov 14, 2017
3
For example:
we can consider an example where we have 10,000 records for a user in our database and let's say only 900 out which are active users, so in this case if we use “IEnumerable” then first it loads all 10,000 records in memory and then applies the IsActive filter on it which eventually returns the 900 active users.
While on the other hand on the same case if we use “IQueryable” it will directly apply the IsActive filter on the database which directly from there will return the 900 active users.
For more differences Link might help you.
Replied by: Tabish Usman | Replied on: Nov 20, 2017