in Dot Net by
Q:

How to use Delegates with Events?

► Click here to show 1 Answer

0 votes
by

 Delegates are used to raise events and handle them. Always a delegate needs to be declared first and then the Events are declared.

Let us see an Example:

Consider a class called Patient. Consider two other classes, Insurance, and Bank which requires Death information of the Patient from patient class. Here, Insurance and Bank are the subscribers and the Patient class becomes the Publisher. It triggers the death event and the other two classes should receive the event.

Learn More with Madanswer

Related questions

+1 vote
asked Jun 25, 2019 in Dot Net by Venkatshastri
...