What's the return type of a LINQ query?

后端 未结 5 598
轻奢々
轻奢々 2021-02-11 22:20

Is it IEnumerable. As far as I know, the reference always points to a class instance. What instance type does the LINQ query really point to?

5条回答
  •  攒了一身酷
    2021-02-11 22:54

    I don't know but I guess it's an internal type. You don't have to think about the class.

    In fact it could be different classes depending on the concrete query. The compiler could convert the LINQ expression to one or another implementation depending on the conditions/processing.

提交回复
热议问题