LANGUAGE

Lambda expression

Anonymous function expression convertible to a compatible delegate or expression tree where supported.

Formal Syntax & Structure

csharp syntaxcsharp
parameters => expression

Working Example

Example Snippetcsharp
using System;Func<int,int> twice = x => x * 2;Console.WriteLine(twice(3));
C# & .NET Reference