- A Delegate is a type which can help passing a function as a parameter – similar to pointer functions.
What are Delegates? How do you use them?
- Events help two objects communicate with each other or be notified when required.
- Events help in building loosely-coupled applications which are extensible.
Dopper dopper = new Dopper();
dopper.DopperDopped += delegate (object o, EventArgs e)
Console.WriteLine("Dopper Event Handled");
public event EventHandler<EventArgs> DopperDopped;
public void DoDope()
protected virtual void CallRaiser()
if (DopperDopped != null)
- Action is a special type of Delegate that represents a method with generic arguments and no return type.
What is the difference between Func and Action delegates in C#?