Click here to Skip to main content
15,886,724 members
Articles / Expressions
Reference

Lambda Expressions

Rate me:
Please Sign up or sign in to vote.
3.44/5 (4 votes)
20 Dec 2015CPOL 59K   13   2
Lambda expressions provide a concise, functional syntax for writing anonymous methods. They are super useful when writing LINQ query expressions.

This articles was originally at wiki.asp.net but has now been given a new home on CodeProject. Editing rights for this article has been set at Bronze or above, so please go in and edit and update this article to keep it fresh and relevant.

Lambda expressions provide a concise, functional syntax for writing anonymous methods. They are super useful when writing LINQ query expressions as they provide a very compact and type-safe way to write functions that can be passed as arguments for subsequent evaluation. Lambda Expressions were introduced in the .NET Framework 3.5.

A lambda expression is identified using the Func keyword, which takes 2 or 3 generic arguments as parameters.  In C#, <alias> => denotes a lamdba expression, whereas Function(<alias>) denotes a lambda in VB.NET.

Articles/Blogs

This article was originally posted at http://wiki.asp.net/page.aspx/113/lambda-expressions

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
The ASP.NET Wiki was started by Scott Hanselman in February of 2008. The idea is that folks spend a lot of time trolling the blogs, googlinglive-searching for answers to common "How To" questions. There's piles of fantastic community-created and MSFT-created content out there, but if it's not found by a search engine and the right combination of keywords, it's often lost.

The ASP.NET Wiki articles moved to CodeProject in October 2013 and will live on, loved, protected and updated by the community.
This is a Collaborative Group

754 members

Comments and Discussions

 
BugBroken Links Pin
Daniel Miller20-Dec-15 11:42
professionalDaniel Miller20-Dec-15 11:42 
GeneralMessage Closed Pin
19-Jan-16 2:44
Top 10 Nhân Loại (Sengoku)19-Jan-16 2:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.