Action Delegate
Action Delegate
What is an Action Delegate?
C# 3.0 introduced built-in generic delegate types Func
and Action
so that we don't have to declare custom delegates. These are included in the System
namespace. Action delegate in C# represents a delegate that has void
return type and optional parameters. An Action delegate can take up to 16 input parameters of different types.
An anonymous method can also be assigned to Action delegate as below
A lambda expression can also be used with Action delegate as below:
Additional Reading
https://itnext.io/delegates-anonymous-methods-and-lambda-expressions-5ea4e56bbd05
Last updated