Exemplo n.º 1
0
        public GeoRepository(
            IOptions<PostgreSqlConnectionOptions> 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;

            dbGeoCountry = new DBGeoCountry(readConnectionString, writeConnectionString, logFactory);
            dbGeoZone = new DBGeoZone(readConnectionString, writeConnectionString, logFactory);
            dbLanguage = new DBLanguage(readConnectionString, writeConnectionString, logFactory);
            dbCurrency = new DBCurrency(readConnectionString, writeConnectionString, logFactory);
        }
Exemplo n.º 2
0
        public GeoRepository(
            IOptions <ConnectionStringOptions> 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;

            dbGeoCountry = new DBGeoCountry(readConnectionString, writeConnectionString, logFactory);
            dbGeoZone    = new DBGeoZone(readConnectionString, writeConnectionString, logFactory);
            dbLanguage   = new DBLanguage(readConnectionString, writeConnectionString, logFactory);
            dbCurrency   = new DBCurrency(readConnectionString, writeConnectionString, logFactory);
        }