IQueryable vs IQueryable

前端 未结 2 611
隐瞒了意图╮
隐瞒了意图╮ 2020-12-19 09:36

I\'m simply wondering why there is a IQueryable version without the generic capability ?

2条回答
  •  清酒与你
    2020-12-19 10:06

    I imagine it's the same reason as Jon Skeet gives in Difference between IEnumerable and IEnumerable? , to allow use in a foreach loop. IQuerable would be castable to IEnumerable, whereas IQueryable would not.

    Also see Marcin's answer about use in dynamic query building scenarios.

提交回复
热议问题