What is the difference between LINQ query expressions and extension methods

后端 未结 8 1071
一个人的身影
一个人的身影 2020-12-23 15:39

Below are two queries that return the same data. Other then style I am not sure which is better.

What factors influence these queries? What are the benefits of us

8条回答
  •  猫巷女王i
    2020-12-23 16:10

    LINQ is buzz word for a technology.

    IQueryable is a .NET Interface which is used by LINQ.

    Other than the style, there is no difference between the two. Use whichever style you prefer.

    I prefer the first style for long statement (like that one shown here) and the second for very short statements.

提交回复
热议问题