The requested page is not available for the requested platform. You are viewing the content for Default platform.

Expand Lambda Expression (C#)

Converts the lambda expression to an equivalent anonymous method.

Availability

Available from the context menu or via shortcuts:

  • when the caret is on the left side of a lambda operator or on a lambda operator (=>).

Notes

Example

Func<string, int> func = s => s.Length;

Result:

Func<string, int> func = delegate(string s) 
{
    return s.Length;
};

Screenshot

rsExpandLambdaExpression