A cache provider used for caching data in the current scope. For example, in a web application the current scope is the current request.
Inheritance: DisposableObject
コード例 #1
0
 protected AbstractRepositoryGroup(GroupedProviderMetadata providers, Uri idRoot, AbstractScopedCache scopedCache, RepositoryContext hiveContext)
 {
     Providers = providers;
     IdRoot = idRoot;
     UnitScopedCache = scopedCache;
     HiveContext = hiveContext;
 }
コード例 #2
0
 public void Setup()
 {
     _frameworkContext = new FakeFrameworkContext();
     _unitScopedCache = new DictionaryScopedCache();
     var providerGroup = GroupedProviderMockHelper.GenerateProviderGroup(1, 0, 1, _frameworkContext);
     var idRoot = new Uri("oh-yeah://this-is-my-root/");
     _groupUnitFactory = new GroupUnitFactory(providerGroup.Writers, idRoot, FakeHiveCmsManager.CreateFakeRepositoryContext(_frameworkContext), _frameworkContext, () => _unitScopedCache);
 }
コード例 #3
0
ファイル: ProviderUnit.cs プロジェクト: RebelCMS/rebelcmsxu5
 public ProviderUnit(AbstractEntityRepository entityRepository, AbstractScopedCache unitScopedCache)
 {
     EntityRepository = entityRepository;
     WorkCompleting += (obj, target) =>
                           {
                               EntityRepository.PrepareForCompletion();
                               EntityRepository.Revisions.PrepareForCompletion();
                               EntityRepository.Schemas.PrepareForCompletion();
                               EntityRepository.Schemas.Revisions.PrepareForCompletion();
                           };
     FrameworkContext = entityRepository.FrameworkContext;
     UnitScopedCache = unitScopedCache;
 }
コード例 #4
0
 public HiveRevisionPostActionEventArgs(IRevision<IVersionableEntity> entity, AbstractScopedCache scopedCache)
 {
     Entity = entity;
     ScopedCache = scopedCache;
 }
コード例 #5
0
 public HiveEntityPostActionEventArgs(IRelatableEntity entity, AbstractScopedCache scopedCache)
 {
     Entity = entity;
     ScopedCache = scopedCache;
 }
コード例 #6
0
 public HiveSchemaPostActionEventArgs(AbstractSchemaPart schemaPart, AbstractScopedCache scopedCache)
 {
     SchemaPart = schemaPart;
     ScopedCache = scopedCache;
 }
コード例 #7
0
 protected AbstractRepositoryGroup(IEnumerable<AbstractProviderRepository> childRepositories, Uri idRoot, AbstractScopedCache scopedCache, RepositoryContext hiveContext)
     : this(new GroupedProviderMetadata(childRepositories), idRoot, scopedCache, hiveContext)
 { }
コード例 #8
0
        public static T GetOrCreateTyped <T>(this AbstractScopedCache cache, string key, Func <T> callback)
        {
            var obj = cache.GetOrCreate(key, () => callback.Invoke());

            return((T)obj);
        }
コード例 #9
0
 public HiveEntityPostDeletionEventArgs(HiveId id, AbstractScopedCache scopedCache)
     : base(scopedCache)
 {
     Id = id;
 }
コード例 #10
0
 public HiveEntityPreActionEventArgs(IRelatableEntity entity, AbstractScopedCache scopedCache)
     : base(scopedCache)
 {
     Entity = entity;
 }
コード例 #11
0
 public HiveSchemaPreActionEventArgs(AbstractSchemaPart schemaPart, AbstractScopedCache scopedCache)
     : base(scopedCache)
 {
     SchemaPart = schemaPart;
 }
コード例 #12
0
 public HiveRelationByIdPostActionEventArgs(IRelationById relation, AbstractScopedCache scopedCache)
     : base(scopedCache)
 {
     Relation = relation;
 }
コード例 #13
0
 public AbstractHiveEventArgs(AbstractScopedCache scopedCache)
 {
     ScopedCache = scopedCache;
 }
コード例 #14
0
 public HiveRelationPostActionEventArgs(IReadonlyRelation<IRelatableEntity, IRelatableEntity> relation, AbstractScopedCache scopedCache)
     : base(scopedCache)
 {
     Relation = relation;
 }
コード例 #15
0
 public HiveQueryResultEventArgs(object result, QueryDescription query, AbstractScopedCache scopedCache)
     : this(Enumerable.Repeat(result, 1).ToArray(), query, scopedCache)
 {
 }
コード例 #16
0
 public HiveQueryResultEventArgs(IEnumerable<object> results, QueryDescription query, AbstractScopedCache scopedCache)
 {
     Results = results;
     ScopedCache = scopedCache;
     QueryDescription = query;
 }
コード例 #17
0
 public HiveRevisionPreActionEventArgs(IRevision<IVersionableEntity> entity, AbstractScopedCache scopedCache)
     : base(scopedCache)
 {
     Entity = entity;
 }