Built-in Delegate Types
Explore how to use C# built-in delegate types such as Action, Func, Predicate, and EventHandler to define method signatures, handle events efficiently, and streamline callbacks without creating custom delegates.
We'll cover the following...
We'll cover the following...
Remember that a delegate’s declaration essentially defines a method signature with a return type. Instead of defining our own delegates, we can use delegates provided by the .NET platform.
The Action delegate
The Action delegate is a generic delegate with the following definition:
public delegate void Action<T>(T parameter);
It returns void and accepts a type ...