public UserRepository( IOptions <MySqlConnectionOptions> 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(UserRepository).FullName); readConnectionString = configuration.Value.ReadConnectionString; writeConnectionString = configuration.Value.WriteConnectionString; dbSiteUser = new DBSiteUser(readConnectionString, writeConnectionString, logFactory); dbUserLogins = new DBUserLogins(readConnectionString, writeConnectionString, logFactory); dbUserClaims = new DBUserClaims(readConnectionString, writeConnectionString, logFactory); dbUserLocation = new DBUserLocation(readConnectionString, writeConnectionString, logFactory); dbRoles = new DBRoles(readConnectionString, writeConnectionString, logFactory); }
public UserRepository( IOptions<MySqlConnectionOptions> 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(UserRepository).FullName); readConnectionString = configuration.Value.ReadConnectionString; writeConnectionString = configuration.Value.WriteConnectionString; dbSiteUser = new DBSiteUser(readConnectionString, writeConnectionString, logFactory); dbUserLogins = new DBUserLogins(readConnectionString, writeConnectionString, logFactory); dbUserClaims = new DBUserClaims(readConnectionString, writeConnectionString, logFactory); dbUserLocation = new DBUserLocation(readConnectionString, writeConnectionString, logFactory); dbRoles = new DBRoles(readConnectionString, writeConnectionString, logFactory); }