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); }
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); }