Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Uday DodiyaRank #239 · 10.3K reputationPosted Sep 1, 2022, 2:31 AM EDT
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)
Sachin SinghRank #66 · 26.2K reputationPosted Sep 1, 2022, 8:36 AM EDT
Rajanikant HawaldarRank #110 · 20.2K reputationPosted Aug 31, 2022, 12:12 PM EDT
Vishal YelveRank #178 · 13.6K reputationPosted Sep 1, 2022, 5:35 AM EDT
This is using Lambdas.
Jaydeep PatilRank #205 · 11.7K reputationPosted Sep 2, 2022, 11:50 PM EDT
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.
Brahma Prakash ShuklaRank #633 · 3.8K reputationPosted Nov 11, 2022, 3:24 AM EST
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.