Differences when using IEnumerable and IQueryable as a type of ObjectSet

前端 未结 4 452
小蘑菇
小蘑菇 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:48

    You are correct about IQueryable. As for IEnumerable, it would hit the database immediately upon assigning IEnumerable user.

    There is no real difference between using Linq Extensions vs. syntax in the example you provided. Sometimes one or the other will be more convenient (see linq-extension-methods-vs-linq-syntax), but IMO it's more about personal preference.

提交回复
热议问题