What is the difference between lambda and linq
Loading
What is the difference between lambda and linq
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Brahma Prakash ShuklaPosted Nov 11, 2022, 8:24 AM
This is Linq:
But can be written with a Lambda:
The Lambda is
b => b.Value == something.Where as
mock.Setup(m => m.SomeOp()).Returns(new Thing());uses a Lambda (them => m.SomeOp()), but has nothing to do with Linq.Jaydeep PatilPosted Sep 3, 2022, 3:50 AM
Language Integrated Query (LINQ) is a feature of Visual Studio that gives you the capabilities yo query on the language syntax of C#, so you will get SQL kinds of queries. And Lambda expression is an anonymous function and is more of a like delegate type.
Sachin SinghPosted Sep 1, 2022, 12:36 PM
Vishal YelvePosted Sep 1, 2022, 9:35 AM
This is using Lambdas.
Uday DodiyaPosted Sep 1, 2022, 6:31 AM
Language-Integrated Query (LINQ) is a set of features introduced in Visual Studio 2008 that extends powerful query capabilities to the language syntax of C# and Visual Basic
A lambda expression is an anonymous function that you can use to create delegates or expression tree types. By using lambda expressions, you can write local functions that can be passed as arguments or returned as the value of function calls.
Linq uses Lambda expression in order to execute some of its functionalities.
Example:
new [] { "Uday", "Nitin", "Jay" }.Where(item => item.Length == 3);
Lambda expression: item => item.Length == 3
Linq: (from item in (new [] {"Uday", "Nitin", "Jay" }) where item.Length == 3)
Rajanikant HawaldarPosted Aug 31, 2022, 4:12 PM