Sunday, May 19, 2013

101 LINQ Samples Lambda style

I have many times had use for the 101 LINQ samples by Microsoft when needing to refresh how to do different kind of queries in with Linq. Often I prefer to have them expressed in Lambda or "fluent" syntax instead of query syntax though, so it has always bothered me that they haven't published them in both formats. Luckily there are tools that allow you to automate conversion between the two formats. I used Resharper by Jetbrains to perform the conversion semi-automatically and have now published all 101*) examples for you in lambda/fluent syntax.

*) Actually there are 102, but hey :)

Head over to linq101.nilzorblog.com to see the result.

Download source (VS2010 project): linq101-lambda-source.zip

6 comments:

  1. Hi Frode,

    Thanks for sharing queries with Lamda Expressions.

    It would be great if you could attach the complete code as zip.I don't have Resharper.

    Thanks,

    Ketan

    ReplyDelete
    Replies
    1. Certainly. Post now edited with link to source code. Sorry for late answer.

      Delete
  2. Thank you ...really helpful contents :)

    ReplyDelete
  3. I would be nice if you could take all the samples in "LINQ 101 Samples - Lambda Style" and make them available as a pdf document to be downloaded

    ReplyDelete
  4. Hi Frode,
    I tried downloading the zip file but I am not able to access the link.
    Request you to kindly fix it!

    ReplyDelete