using System.Collections.Generic;
public static void Main()
List<INotifier> bar = new List<INotifier>();
INotifier x = new Notifier1();
INotifier y = new Notifier2();
Controller foo = new Controller(bar);
private IEnumerable<INotifier> _notifiers;
public Controller(IEnumerable<INotifier> notifiers)
this._notifiers = notifiers;
_notifiers.ToList().ForEach(x => x.Notify());
public interface INotifier
public class Notifier1 : INotifier
Console.WriteLine("Debugging from Notifier 1");
public class Notifier2 : INotifier
Console.WriteLine("Debugging from Notifier 2");