C# Language Lambda Expressions as Shorthand for Delegate Initialization

Download C# Language for free

Example

public delegate int ModifyInt(int input);
ModifyInt multiplyByTwo = x => x * 2;

The above Lambda expression syntax is equivalent to the following verbose code:

public delegate int ModifyInt(int input);

ModifyInt multiplyByTwo = delegate(int x){
    return x * 2;
};
Lambda Expressions with Multiple Parameters or No Parameters