コード例 #1
0
        public GeoRepository(
            IOptions<FirebirdConnectionOptions> 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);
        }
コード例 #2
0
ファイル: GeoRepository.cs プロジェクト: okusnadi/cloudscribe
        public GeoRepository(
            IOptions <FirebirdConnectionOptions> 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.Options.ReadConnectionString;
            writeConnectionString = configuration.Options.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);
        }