Can anyone please provide me with
1. The differences between Linq queries and lambda expressions
and the syntaxes for using them.
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
Ananth GRank #1,176 · 1.5K reputationPosted Nov 2, 2016, 10:29 PM EDT
LINQ – Lambda Expression vs Query Expression
Both yields the same result because query expressions are translated into their lambda expressions before they’re compiled. So performance-wise, there’s no difference whatsoever between the two.
Which one you should use is mostly personal preference, many people prefer lambda expressions because they’re shorter and more concise, but personally I prefer the query syntax having worked extensively with SQL. With that said, it’s important to bear in mind that there are situations where one will be better suited than the other.
Joins
Here’s an example of how you can join sequence together using Lambda and query expressions:
Lambda-Only Functions
There are a number of methods that are only available with the Lambda expression, Single(), Take(), Skip(), First() just to name a few. Although you can mix and match the two by calling the Lambda-only methods at the end of the query:
Midhun TpRank #388 · 6.5K reputationPosted Nov 2, 2016, 9:01 PM EDT
Please follow below links. The linq queries are converted to lambda expression before compilation -
http://theburningmonk.com/2010/02/linq-lambda-expression-vs-query-expression/
https://blogs.msdn.microsoft.com/wriju/2006/12/06/linq-query-vs-lambda-expression/
Surya KantRank #958 · 2.1K reputationPosted Nov 2, 2016, 9:27 PM EDT