Can you advise me an a resource with simple C# LINQ/lambda-expressions code exercises?
Desirable but not obligatory: online, free, with answers, step by step, the simplest and fast, to study the syntax but not complicated puzzles or world problems.
I do not think it is duplicated with
since it was 2+ years ago, so propably outdated, and it did not contain any good reference (looked through all of them).
The best google search result I managed to find is:
though I am not satisfied.
Update:
Something similar to LINQ Quiz which is for me the best reference I could find to this moment.
Adding with Kristin's answer, There is no difference in performance because after compile they generate same IL code for the same query. Language Integrated Query (LINQ) is feature of Visual Studio that gives you the capabilities yo query on the language syntax of C#, so you will get SQL kind of queries.
There is no performance difference between LINQ queries and Lambda expressions.
LINQ is a library that contains a set of extension methods (mostly to IEnumerable) that makes heavy uses of lambdas. The lambda is itself an anonymous delegate and is just simple syntax sugar. It gives you an easy way to define a function "in line" and pass that function to some method.
A very good ressource for LINQ is Jon Skeet's blog "Reimplementing LINQ
to Objects".
He reimplements the whole LINQ functionality step by step giving excellent insights about the inner workings.
Reimplementing LINQ to Objects
This is not a tutorial of such but I've found it very usefull for the linq side of things...
http://code.msdn.microsoft.com/101-LINQ-Samples-3fb9811b
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