Ejemplo n.º 1
0
        public GeoRepository(
            IOptions<MSSQLConnectionOptions> connectionOptions,
            ILoggerFactory loggerFactory)
        {
            if (connectionOptions == null) { throw new ArgumentNullException(nameof(connectionOptions)); }
            if (loggerFactory == null) { throw new ArgumentNullException(nameof(loggerFactory)); }

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

            readConnectionString = connectionOptions.Value.ReadConnectionString;
            writeConnectionString = connectionOptions.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);
        }
Ejemplo n.º 2
0
        public GeoRepository(
            IOptions <MSSQLConnectionOptions> connectionOptions,
            ILoggerFactory loggerFactory)
        {
            if (connectionOptions == null)
            {
                throw new ArgumentNullException(nameof(connectionOptions));
            }
            if (loggerFactory == null)
            {
                throw new ArgumentNullException(nameof(loggerFactory));
            }

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

            readConnectionString  = connectionOptions.Value.ReadConnectionString;
            writeConnectionString = connectionOptions.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);
        }