コード例 #1
0
        public SiteRepository(
            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(SiteRepository).FullName);

            readConnectionString = configuration.Value.ReadConnectionString;
            writeConnectionString = configuration.Value.WriteConnectionString;

            dbSiteSettings = new DBSiteSettings(readConnectionString, writeConnectionString, logFactory);
            dbSiteSettingsEx = new DBSiteSettingsEx(readConnectionString, writeConnectionString, logFactory);
            dbSiteFolder = new DBSiteFolder(readConnectionString, writeConnectionString, logFactory);

        }
コード例 #2
0
ファイル: SiteRepository.cs プロジェクト: fazueu/cloudscribe
        public SiteRepository(
            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(SiteRepository).FullName);

            readConnectionString  = configuration.Value.ReadConnectionString;
            writeConnectionString = configuration.Value.WriteConnectionString;

            dbSiteSettings   = new DBSiteSettings(readConnectionString, writeConnectionString, logFactory);
            dbSiteSettingsEx = new DBSiteSettingsEx(readConnectionString, writeConnectionString, logFactory);
            dbSiteFolder     = new DBSiteFolder(readConnectionString, writeConnectionString, logFactory);
        }