private bool CheckConfig(MessageSenderConfig config) { if (string.IsNullOrWhiteSpace(config.Url)) { throw new InvalidOperationException("MessageSenderConfig Url is missing"); } if (string.IsNullOrWhiteSpace(config.ChannelName)) { throw new InvalidOperationException("MessageSenderConfig ChannelName is missing"); } return(true); }
public MessageSenderService(ILogger <MessageSenderService> logger, IOptionsSnapshot <MessageSenderConfig> config) { _logger = logger; _config = config.Value; CheckConfig(_config); }