I am learning Linq. Most of the Linq examples available are in query expression format. To understand it better I would like to learn what a query expression looks like in dot notation or lambda syntax. Though I can translate the simple query expressions in dot format, I find myself wanting when the expressions grow complicated.
Are there any general rules to do this conversion by hand?
Also is there a tool which can do such conversion for me from query expression to dot format and vice versa? The C# compiler pre-processes the query expression into dot format before doing the compilation. If there is no such tool is there a way to look at the preprocessed code before it is compiled?
Yes, get yourself a copy of LINQPad. This is an excellent tool for learning LINQ. The tool is free and allows you to do very simple and very complex LINQ prototyping. You can also intermingle C# code as well. It will show you your queries in Lambda form and also show you the resulting T-SQL code, if you are querying a database.
Highly recommended.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With