using System.Collections.Generic;
public static void Main(string[] args)
var notification = new Notification(new List<IProcess>
new CloudNotifier(), new OnPremiseProvider(), new GalaxyNotifier()}
public class Notification
private readonly IEnumerable<IProcess> _providerList;
public Notification(IEnumerable<IProcess> providerList)
_providerList = providerList;
foreach (var notificationProvider in _providerList)
notificationProvider.Process();
public interface IProcess
public class OnPremiseProvider : IProcess
Console.WriteLine("You're getting these notifications because you opted for OnPremise Notifications....");
public class CloudNotifier : IProcess
Console.WriteLine("You're getting these notifications because you opted for Cloud Notifications....");
public class GalaxyNotifier : IProcess
Console.WriteLine("You're getting these notifications because you opted for Galaxy Notifications....");