Difference between LINQ Queries & Lambda expression

前端 未结 2 1624
耶瑟儿~
耶瑟儿~ 2020-12-31 18:10

Why to use lambda expression when we have LINQ queries just to shorten the length of code , increase the speed of development or is there any other reason which can only be

2条回答
  •  梦毁少年i
    2020-12-31 18:29

    any other reason which can only be achieved by Lambda expression & not by LINQ queries.

    There are some LINQ extension methods which do not have counterparts in LINQ query expressions, and will require the use of Lambda Expressions. A good example is Enumerable.ToLookup - if you want to create an ILookup, you need to use lambdas to generate this.

提交回复
热议问题