Esempio n. 1
0
        public SiteRepository(
            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(SiteRepository).FullName);

            readConnectionString = connectionOptions.Value.ReadConnectionString;
            writeConnectionString = connectionOptions.Value.WriteConnectionString;
            
            dbSiteSettings = new DBSiteSettings(readConnectionString, writeConnectionString, logFactory);
            dbSiteSettingsEx = new DBSiteSettingsEx(readConnectionString, writeConnectionString, logFactory);
            dbSiteFolder = new DBSiteFolder(readConnectionString, writeConnectionString, logFactory);

        }
Esempio n. 2
0
        public SiteRepository(
            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(SiteRepository).FullName);

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

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