Differences when using IEnumerable and IQueryable as a type of ObjectSet

前端 未结 4 516
小蘑菇
小蘑菇 2021-02-09 08:19

As I understand it when I use LINQ extension methods (with lambda expression syntax) on IQueryable that is in the fact instance of ObjectSet they are t

4条回答
  •  眼角桃花
    2021-02-09 08:36

    The difference is that IEnumerable performs the filters if they are more, one at a time. For example, from 100 elements will output 20 by the first filter and then will filter second time the needed 10. It will make one query to the database but will download unnecessary data. Using IQueryable will download again with one query but only the required 10 items. The following link gives some excellent examples of how these queries work: https://filteredcode.wordpress.com/2016/04/29/ienumerable-vs-iqueryable-part-2-practical-questions/

提交回复
热议问题