Lambda Expressions: An Introduction
My presentation at our local Code Camp was fun. I covered a lot of material and had a GREAT audience. Several people have asked for the slide information in my blog. So this is the start of several posts on lambda expressions.
In addition, I wrote an article on lambda expressions that should appear in the Jan/Feb 2010 issue of Code Magazine. I’ll post the link as soon as its published. (See Edit below.)
You can find sample code that demonstrates many different lambda expressions here.
Lambda expressions are unnamed, inline functions. They are new in Visual Basic 9 and C# 3.0 (VS 2008). You can use a lambda expression anywhere a delegate is required. For more information on delegates, see this post.
Here are an additional set of posts that cover the slides and information from my talk:
- Generics: Building a List of Customers
- Lambda Expressions: Finding an Item in a Generic List
- Lambda Expressions: Syntax
- Lambda Expressions: Predicate Delegates
- Lambda Expressions: Action Delegates
- Lambda Expressions: Func Delegates
- Lambdas: Aggregating Strings
- Lambda Expressions: Finding Differences in Two Lists
I will be adding more as time permits.
Enjoy!
EDIT: 1/4/2010
The Code Magazine article was published in the Jan/Feb 2010 issue and is here.
Added a link to sample code above.
Adolphee — October 12, 2012 @ 4:52 pm
Hi
I am trying to covert this expression form C# to VB. but no success.
Any help would be appreciated
this.PropertyChanged += (s, e) =>
{
if (e.PropertyName == “ActiveItem”)
{
NotifyOfPropertyChange(() => CanCloseActiveItem);
}
};