// Version 3: using Func<T> as a factory method. static INotificationManager GetNotificationService_V3() { Func<IMessageService> factoryMethod = new MessageServiceFactory().GetService; return new NotificationManager(factoryMethod); }
// Version 3: using Func<T> as a factory method. static INotificationManager GetNotificationService_V3() { Func <IMessageService> factoryMethod = new MessageServiceFactory().GetService; return(new NotificationManager(factoryMethod)); }