public static void Main()
var publisher = new Publisher();
new Subscriber(publisher);
new Subscriber1(publisher);
new Subscriber(publisher);
new Subscriber1(publisher);
new Subscriber(publisher);
new Subscriber1(publisher);
public Action MethodToBePublished;
public class Subscriber {
public Subscriber(Publisher publisher){
publisher.MethodToBePublished += SayHello;
Console.WriteLine("Hello from SUBSCRIBER1 OK");
public class Subscriber1 {
public Subscriber1(Publisher publisher){
publisher.MethodToBePublished += SayHello;
Console.WriteLine("Hello from SUBSCRIBER2 OK OK");