public SystemContext(IOptions <OspSystemConfiguration> systemConfiguration, IDistributedWithPubSubCache distributedWithPubSubCache) { ArgumentValidation.Validate(nameof(systemConfiguration), systemConfiguration); ArgumentValidation.Validate(nameof(distributedWithPubSubCache), distributedWithPubSubCache); _systemConfiguration = systemConfiguration.Value; _distributedWithPubSubCache = distributedWithPubSubCache; var sharedSettings = new MongoConnectionOptions { MongoDbHost = _systemConfiguration.DatabaseHost, MongoDbUsername = _systemConfiguration.AdminUser, MongoDbPassword = _systemConfiguration.AdminUserPassword, AuthenticationSource = _systemConfiguration.AuthenticationDatabaseName }; _ckCaches = new ConcurrentDictionary <string, ICkCache>(); _repositoryClient = new MongoRepositoryClient(sharedSettings); OspSystemDatabase = _repositoryClient.GetRepository(_systemConfiguration.SystemDatabaseName); _tenantCollection = OspSystemDatabase.GetCollection <SystemEntities.OspTenant>(); _configurationCollection = OspSystemDatabase.GetCollection <OspConfiguration>(); var sub = _distributedWithPubSubCache.Subscribe <string>(CacheCommon.KeyTenantUpdate); sub.OnMessage(message => { RemoveCkCache(message.Message); return(Task.CompletedTask); }); }
public ResourceStore(ISystemContext systemContext) { _repository = systemContext.OspSystemDatabase; _apiResourceCollection = _repository.GetCollection <OspApiResource>(); _identityResourceCollection = _repository.GetCollection <OspIdentityResource>(); _apiScopeCollection = _repository.GetCollection <OspApiScope>(); }
internal StatementCreator(ICachedCollection <TEntity> cachedCollection, string language = "en") { _cachedCollection = cachedCollection; Language = language; _idFilters = new List <FilterDefinition <TEntity> >(); _fieldFilters = new List <FilterDefinition <TEntity> >(); _attributeSearchFilter = new List <FilterDefinition <TEntity> >(); _sortDefinitions = new List <SortDefinition <TEntity> >(); _bsonClassMap = new BsonClassMap <TEntity>(); _bsonClassMap.AutoMap(); }
public PermissionStore(ISystemContext systemContext) { _repository = systemContext.OspSystemDatabase; _permissionCollection = _repository.GetCollection <OspPermission>(); }
public IdentityProviderStore(ISystemContext systemContext) { _repository = systemContext.OspSystemDatabase; _providerCollection = _repository.GetCollection <OspIdentityProvider>(); }
public PersistentGrantStore(ISystemContext systemContext) { _repository = systemContext.OspSystemDatabase; _persistentGrantCollection = _repository.GetCollection <OspPersistedGrant>(); }
public ClientStore(ISystemContext systemContext) { _repository = systemContext.OspSystemDatabase; _clientCollection = _repository.GetCollection <OspClient>(); }