When I was a beginner Entity Framework, I didn't realize IQueryable. At that time, the data from the database are all the first to remove all the records, put on memory, and then the data on these memory screening. When the data is low, this method is also so-so. But with a lot of data, performance issues are highlighted.
The difference between ienumberable and IQueryable.
Source: IEnumerable VS IQueryable
ienumberable applies To collection data in query memory . such as List,arrary,linq to Object,linq to XML
When it is used to query data in a database, the procedure is as follows: Perform a query search (without complex filtering) on the server side (database) to load the data that is found in the client's memory to filter the data in the client's memory
Because IEnumerable does not support lazy loading .
IQueryable applies to collection data outside of query memory . such as databases, LINQ to Sql,service
When it is used to query data in a database, the query and all filters are placed on the server side (database).
because IQueryable supports lazy loading . (so apply to paging scenes)