Exemple #1
0
        private void UpdateFromEnv(MysqlOption _rab)
        {
            var dbTables = _configuration["mysql.dbTables"];

            if (!string.IsNullOrEmpty(dbTables))
            {
                _rab.DbTables = dbTables.Split(':').ToList();
            }
        }
Exemple #2
0
        public MysqlHandler(ILogger <MysqlHandler> logger, IOptions <MysqlOption> options, IDbTransfer dbTypeMapper, IConfiguration configuration)
        {
            _logger        = logger;
            _configuration = configuration;
            _dbTypeMapper  = dbTypeMapper;
            _option        = options?.Value;
            if (_option == null)
            {
                _option = new MysqlOption();
            }
            UpdateFromEnv(_option);
            if (_option.DbTables == null || !_option.DbTables.Any())
            {
                throw new ArgumentNullException(nameof(MysqlOption.DbTables));
            }

            _logger.LogInformation($"Mysql Produce Listening: {string.Join(",", _option.DbTables)}");
        }
Exemple #3
0
        public MysqlHandler(ILogger <MysqlHandler> logger, IOptions <MysqlOption> options, IDbTransfer dbTypeMapper, IConfiguration configuration)
        {
            _logger        = logger;
            _configuration = configuration;
            _dbTypeMapper  = dbTypeMapper;
            _option        = options?.Value;
            if (_option == null)
            {
                _option = new MysqlOption();
            }

            if (_option.DbTables == null)
            {
                _option.DbTables = new List <string>();
            }

            UpdateFromEnv(_option);

            _logger.LogInformation(_option.DbTables.Any()
                ? $"Mysql Produce Listening: {string.Join(",", _option.DbTables)}"
                : $"Mysql Produce Listening");
        }