public SmsService(ISmsServiceConfig smsServiceConfig) { if (smsServiceConfig == null) { throw new ApplicationException("SMS service configuration was not found!"); } _smsServiceConfig = smsServiceConfig; ValidateConfiguration(); }
/// <inheritdoc/> public void SetConfig(ISmsServiceConfig smsServiceConfig) { this._smsServiceConfig = smsServiceConfig; ValidateConfiguration(); }
/// <inheritdoc/> public bool IsValid(ISmsServiceConfig smsServiceConfig) { return(!string.IsNullOrWhiteSpace(Recepient) && (!(smsServiceConfig?.CharacterLimit.HasValue ?? false) || Message.Length <= smsServiceConfig?.CharacterLimit)); }
/// <inheritdoc/> public bool IsValid(ISmsServiceConfig smsServiceConfig) { return((Recepients?.Any() ?? false) && (Recepients?.All(x => !string.IsNullOrWhiteSpace(x)) ?? false) && (smsServiceConfig?.CharacterLimit.HasValue ?? false ? Message.Length <= smsServiceConfig?.CharacterLimit : true)); }