linq - How the C# compiler treats query expressions ?(Dotnet 3.5, C#3.0) -


Going through a question from my favorite authors, I am basically looking for an answer to this question :

How C # compiler treats query expressions

thanks

The compiler will evaluate and convert your query expression into the equivalent lambda syntax before compiling the code. So a code that happens from

  var query = to foo where choose foo.Bar == someString new {Baz = foo.Baz, id = foo.Id};  

will be transformed into lambda version

  var query = foos.Where (f => f.bar == someString). Select (f = & gt; new {falcon = F. falcon, id = F.ID});  

The same will be your complex join, group, etc.


Comments