← All notes

C# lambda expressions and delegates

Short answer

To create a lambda expression, specify input parameters (if any) on the left side of the lambda operator and an expression or a statement block on the other side. (S1) Lambdas are usually assigned to delegate types such as Func<> and Action<>, which are type-safe references to methods. [S1][S2]

Func<int, int> square = x => x * x;
Action<string> log = msg => { Console.WriteLine(msg); };

Key points

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted).

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Microsoft Learn (.NET docs), Lambda expressions - Lambda expressions and anonymous functions - C# reference, CC BY 4.0 (dotnet/docs); Microsoft Learn (.NET docs), Work with delegate types in C# - C#, CC BY 4.0 (dotnet/docs).

Cite this

Permanent ID: iil:note:0qswyhpx

iinventedlight. 2026. "C# lambda expressions and delegates." iinventedlight Library, iil:note:0qswyhpx, version of 2026-11-04. https://iinventedlight.com/library/notes/csharp-lambda-expressions/. License: CC-BY-4.0.

@misc{iil_note_0qswyhpx,
  author = {{iinventedlight}},
  title = {{C\# lambda expressions and delegates}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-04},
  url = {https://iinventedlight.com/library/notes/csharp-lambda-expressions/},
  note = {Permanent ID iil:note:0qswyhpx. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.

For language models and agents: start at /llms.txt. This page in Markdown: /library/notes/csharp-lambda-expressions.md.