Пример #1
0
 /// <summary>
 /// Constructor
 /// </summary>
 public IdGeneratorSvc(IRedisClientsManager redisManager,
     IConfigurationSvc configurationSvc,
     ILoggerFactory loggerFactory)
 {
     this.redisManager = redisManager;
     logger = loggerFactory.GetLogger(GetType());
     idKeyPrefix = configurationSvc.GetStringConfig("IdGenerator:$Internal$:KeyPrefix", "BHS:IdGenKey:");
     idKeyPrefix = StringUtils.MustEndWith(idKeyPrefix, ":");
     logger.Info("Using " + idKeyPrefix + " as prefix for id generation keys in Redis");
 }
Пример #2
0
        /// <summary>
        /// Constructor
        /// </summary>
        public EmailDeliverySvc(IConfigurationSvc configurationSvc,
            ILoggerFactory loggerFactory)
        {
            logger = loggerFactory.GetLogger(GetType());

            port = configurationSvc.GetIntConfig("SMTPPort", false, 25);
            enableSsl = configurationSvc.GetBooleanConfig("STMPEnableSSL", false);
            host = configurationSvc.GetStringConfig("SMTPHost");
            userName = configurationSvc.GetStringConfig("SMTPUser", false);
            if (!string.IsNullOrEmpty(userName)) password = configurationSvc.GetStringConfig("SMTPPassword");
            timeoutMSecs = configurationSvc.GetIntConfig("STMPTimeoutSecs", false, 1) * 1000;
            useDefaultCredentials = configurationSvc.GetBooleanConfig("SMTPUseDefaultCredentials", false);

            logger.Info("EmailDeliverySvc started with "
                + "Port: " + port
                + ", EnableSSL: " + enableSsl
                + ", Host: " + host
                + ", UserName: "******", TimeoutMSecs: " + timeoutMSecs);
        }