Assigning to a delegate by lambda

suggest change

Lambdas can be used to create anonymous methods to assign to a delegate:

Func<int,int> addOne = x => x+1;

Note that the explicit declaration of type is required when creating a variable this way:

var addOne = x => x+1; // Does not work

Feedback about page:

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

Table Of Contents