Lambda Expressions as Shorthand for Delegate Initialization

suggest change
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;
};

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents