Has anyone done the job of translating the 101 Linq samples published by Microsoft to Lambda syntax?
If no, does anyone know a site to use as starting point for learning Linq Lambda syntax? I liked the format of the 101 Linq samples, so something similar would be appreciated.
The term 'Lambda expression' has derived its name from 'lambda' calculus which in turn is a mathematical notation applied for defining functions. Lambda expressions as a LINQ equation's executable part translate logic in a way at run time so it can pass on to the data source conveniently.
There are the following two ways to write LINQ queries using the Standard Query operators, in other words Select, From, Where, Orderby, Join, Groupby and many more. Using lambda expressions. Using SQL like query expressions.
Types such as ArrayList that support the non-generic IEnumerable interface can also be used as a LINQ data source.
I finally got around to do this job myself :-) All 101 samples are now converted to Lambda/Fluent syntax and published at Linq101.nilzorblog.com
If you want to learn lambda syntax, download LinqPad. Then write the normal syntax Eg:
from f in Features
where f.Id > 0
select f
Then run it, and at the bottom you'll see "Results lambda SQL IL" Simply click on the Lambda, and you'll see:
Features.Where(f => (f.Id > 0))
It doesn't always produce the cleanest syntax, but it is a way to learn the lambda syntax.
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