Example #1
0
        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);
        }
Example #2
0
 public MessageSenderService(ILogger <MessageSenderService> logger, IOptionsSnapshot <MessageSenderConfig> config)
 {
     _logger = logger;
     _config = config.Value;
     CheckConfig(_config);
 }