Пример #1
0
        public UserRepository(
            SQLiteConnectionstringResolver connectionStringResolver,
            IOptions <MultiTenantOptions> multiTenantOptions,
            ILoggerFactory loggerFactory)
        {
            if (multiTenantOptions == null)
            {
                throw new ArgumentNullException(nameof(multiTenantOptions));
            }
            if (connectionStringResolver == null)
            {
                throw new ArgumentNullException(nameof(connectionStringResolver));
            }
            if (loggerFactory == null)
            {
                throw new ArgumentNullException(nameof(loggerFactory));
            }

            this.multiTenantOptions = multiTenantOptions.Options;
            logFactory       = loggerFactory;
            log              = loggerFactory.CreateLogger(typeof(UserRepository).FullName);
            connectionString = connectionStringResolver.Resolve();

            dbSiteUser     = new DBSiteUser(connectionString, logFactory);
            dbUserLogins   = new DBUserLogins(connectionString, logFactory);
            dbUserClaims   = new DBUserClaims(connectionString, logFactory);
            dbUserLocation = new DBUserLocation(connectionString, logFactory);
            dbRoles        = new DBRoles(connectionString, logFactory);
        }
Пример #2
0
        public UserRepository(
            SqliteConnectionstringResolver connectionStringResolver,
            ILoggerFactory loggerFactory)
        {
            if (connectionStringResolver == null) { throw new ArgumentNullException(nameof(connectionStringResolver)); }
            if (loggerFactory == null) { throw new ArgumentNullException(nameof(loggerFactory)); }

            logFactory = loggerFactory;
            log = loggerFactory.CreateLogger(typeof(UserRepository).FullName);
            connectionString = connectionStringResolver.Resolve();

            dbSiteUser = new DBSiteUser(connectionString, logFactory);
            dbUserLogins = new DBUserLogins(connectionString, logFactory);
            dbUserClaims = new DBUserClaims(connectionString, logFactory);
            dbUserLocation = new DBUserLocation(connectionString, logFactory);
            dbRoles = new DBRoles(connectionString, logFactory);
        }