Delegates, lambdas, Func, and Action in C#
A delegate is a type-safe function pointer: it holds a reference to a method with a specific signature. Lambdas are anonymous methods written inline using the => syntax. Func, Action, and Predicate are built-in generic delegate types that cover the most common signatures so you rarely need to declare your own delegate.
On this page
Declaring and Using a Delegate
Lambda Expressions
A lambda is an anonymous function written inline. It replaces a named method when the logic is short and used only once.
Func<T, TResult>: Delegate That Returns a Value
Func accepts up to 16 input parameters and one return type (last type argument).
Action<T>: Delegate That Returns void
Use Action when the method performs a side effect and returns nothing.
Predicate<T>: Specialized Func<T, bool>
Predicate<T> is shorthand for Func<T, bool>; commonly used with List.Find, List.FindAll, and List.RemoveAll.
Closures: Capturing Variables
Lambdas can capture variables from their enclosing scope. The lambda holds a reference, not a copy.
Storing and Passing Delegates as Parameters
Func vs Action vs Delegate: Quick Reference
| Type | Signature | Returns | When to use |
|---|---|---|---|
Action | () | void | Side-effect only, no return |
Action<T> | (T arg) | void | Side-effect, one input |
Func<TResult> | () | TResult | No input, returns a value |
Func<T, TResult> | (T arg) | TResult | One input, returns a value |
Predicate<T> | (T arg) | bool | Filter / test condition |
| Custom delegate | Any | Any | Multicast events, callbacks with events |
Take It Further

The most comprehensive book covering C# 12 and .NET 8 from scratch to production.
C# 12 and .NET 8: Modern Cross-Platform Development · Mark J. Price
Get it on Amazon →As an Amazon Associate I earn from qualifying purchases.
Related Articles
Filter a collection in C# with LINQ Where() by passing a predicate function. Uses deferred execution and returns only elements satisfying the condition.
Use LINQ Select() in C# to project each element into a new form. Transforms a collection with a lambda and returns a new IEnumerable with the results.
Learn how async and await enable asynchronous programming in C#, letting methods suspend execution without blocking the calling thread.
Learn C# pattern matching with is expressions, switch expressions, type patterns, property patterns, relational patterns, and list patterns.