예제 #1
0
        public ApplicationUserStore(Lazy <ApplicationUserStoreCache> userCache,
                                    ISystemDocumentStorageFactory documentStorageFactory)
        {
            // Lazy, чтобы подписка на изменения кэша пользователей в кластере не создавалась сразу

            _userCache   = userCache;
            _userStorage = new Lazy <ISystemDocumentStorage <ApplicationUser> >(() => documentStorageFactory.GetStorage <ApplicationUser>());
        }
예제 #2
0
        public DocumentHttpService(IDocumentHttpServiceHandlerBase serviceHandler,
                                   IDocumentQueryFactory <TDocument> queryFactory,
                                   IDocumentStorageFactory storageFactory,
                                   ISystemDocumentStorageFactory systemStorageFactory,
                                   IBlobStorage blobStorage,
                                   IPerformanceLog performanceLog,
                                   ILog log)
            : base(performanceLog, log)
        {
            var storage = serviceHandler.AsSystem
                ? systemStorageFactory.GetStorage <TDocument>(serviceHandler.DocumentType)
                : storageFactory.GetStorage <TDocument>(serviceHandler.DocumentType);

            DocumentType = storage.DocumentType;
            CanGet       = serviceHandler.CanGet;
            CanPost      = serviceHandler.CanPost;
            CanDelete    = serviceHandler.CanDelete;

            _serviceHandler = (IDocumentHttpServiceHandler <TDocument>)serviceHandler;
            _queryFactory   = queryFactory;
            _blobStorage    = blobStorage;
            _storage        = storage;
        }