Which LINQ syntax is better?

There are multiple ways to write a LINQ query in C#:
  • Use query (comprehension) syntax.
  • Use method or Lambda syntax or Fluent syntax.
  • Use a combination of query syntax and method syntax.
So which syntax is better?

MSDN recommends writing most queries using query syntax to create query expressions. The general opinion in this StackOverflow thread seems to be - "it depends".

One Lambda syntax fan converted the MSDN 101 LINQ Samples which were in query syntax to Lambda syntax using LinqPad.

Comments