public string GetDeliveryContacts(NotificationProtocolType protocol, Users user) { switch (protocol) { case NotificationProtocolType.Email: return(user.Email); default: throw new Exception(Resources.Resources.NotificationProtocolIsNotSupported.FormatWith(protocol)); } }
public INotificationSender Get(NotificationProtocolType protocolType) { try { return(_unityContainer.Resolve <INotificationSender>(protocolType.ToString())); } catch (ResolutionFailedException exc) { throw new UnknownNotificationProtocolTypeException(protocolType, exc); } }
public static IUnityContainer RegisterNotificationSender <T>(this IUnityContainer container, NotificationProtocolType protocolType, ReuseScope reuseScope) where T : class, INotificationSender => container.RegisterType <INotificationSender, T>(protocolType.ToString(), reuseScope);
public UnknownNotificationProtocolTypeException(NotificationProtocolType notificationProtocolType, // ReSharper disable once SuggestBaseTypeForParameter ResolutionFailedException exc) : base(Properties.Resources.UnknownNotificationProtocolType.FormatWith(notificationProtocolType), exc) { }
protected BaseNotificationProtocolConfiguration( NotificationProtocolType type) { this.Type = type; }