예제 #1
0
        public LogRepository(
            IOptions<MySqlConnectionOptions> configuration)
        {
            if (configuration == null) { throw new ArgumentNullException(nameof(configuration)); }
            //if (loggerFactory == null) { throw new ArgumentNullException(nameof(loggerFactory)); }

            //logFactory = loggerFactory;
            //log = loggerFactory.CreateLogger(typeof(GeoRepository).FullName);

            readConnectionString = configuration.Value.ReadConnectionString;
            writeConnectionString = configuration.Value.WriteConnectionString;

            dbSystemLog = new DBSystemLog(readConnectionString, writeConnectionString);
        }
예제 #2
0
        public LogRepository(
            IOptions <MySqlConnectionOptionscs> configuration,
            ILoggerFactory loggerFactory)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }
            if (loggerFactory == null)
            {
                throw new ArgumentNullException(nameof(loggerFactory));
            }

            logFactory = loggerFactory;
            log        = loggerFactory.CreateLogger(typeof(GeoRepository).FullName);

            readConnectionString  = configuration.Value.ReadConnectionString;
            writeConnectionString = configuration.Value.WriteConnectionString;

            dbSystemLog = new DBSystemLog(readConnectionString, writeConnectionString, logFactory);
        }