Action, Func, Predicate (and other C# System-Level Delegates)
C# Delegate Types
C# has several System-level delegate types. Here are the most popular:
- Action
- AsyncCallback
- Comparison
- Converter
- EventHandler
- Func
- Takes zero to 16 parameters.
- Returns a value specified by TResult.
- Func<TResult>
- Func<T1, TResult>
- Func<T1, …, T16, TResult>
- Predicate
- Has one parameter.
- Returns a bool.
- Predicate<T>
We instantiate C# delegate types in three ways:
- Named Methods
- Anonymous Methods, and
- Lambdas
See also:
How to: Declare, Instantiate, and Use a Delegate (C# Programming Guide)