public static SMSProviderBase GetProvider(IMessageStorage storage, SMSProviderType type) { switch (type) { case SMSProviderType.Thread: return(new SMSProviderThread(storage)); case SMSProviderType.Task: return(new SMSProviderTask(storage)); default: throw new NotImplementedException($"Not implemented logic for {type.ToString()} in {nameof(SMSProviderType)}"); } }
public SMSProvider GetSMSProvider(SMSProviderType type, string phoneNumber) { switch (type) { case SMSProviderType.TASK: return(new SMSProviderTask(phoneNumber)); case SMSProviderType.THREAD: return(new SMSProviderThread(phoneNumber)); default: throw new NotSupportedException($"{type.ToString()} is not supported yet."); } }