예제 #1
0
 public CachingCommandDefinition(DbCommandDefinition commandDefinition, CommandTreeFacts commandTreeFacts, CacheTransactionHandler cacheTransactionHandler, CachingPolicy cachingPolicy)
 {
     _commandDefintion        = commandDefinition;
     _commandTreeFacts        = commandTreeFacts;
     _cacheTransactionHandler = cacheTransactionHandler;
     _cachingPolicy           = cachingPolicy;
 }
 public CachingCommandDefinition(DbCommandDefinition commandDefinition, CommandTreeFacts commandTreeFacts, CacheTransactionHandler cacheTransactionHandler, CachingPolicy cachingPolicy)
 {
     _commandDefintion = commandDefinition;
     _commandTreeFacts = commandTreeFacts;
     _cacheTransactionHandler = cacheTransactionHandler;
     _cachingPolicy = cachingPolicy;
 }
예제 #3
0
        public static void Initialize(ICache cache, CachingPolicy cachingPolicy)
        {
            var transactionHandler = new CacheTransactionHandler(cache);

            DbConfiguration.Loaded +=
                (sender, args) => args.ReplaceService <DbProviderServices>(
                    (dbServices, _) => new CachingProviderServices(dbServices, transactionHandler, cachingPolicy));
            DbInterception.Add(transactionHandler);
        }
예제 #4
0
        public Configuration()
        {
            var transactionHandler = new CacheTransactionHandler(UnitOfWork.UnitOfWork.Cache);

            AddInterceptor(transactionHandler);

            var cachingPolicy = new CachingPolicy();

            Loaded += (sender, args) => args.ReplaceService<DbProviderServices>((s, _) =>
                new CachingProviderServices(s, transactionHandler, cachingPolicy));
        }
예제 #5
0
        public AppDbConfiguration()
        {
            var transactionHandler = new CacheTransactionHandler(new InMemoryCache());

            AddInterceptor(transactionHandler);

            var cachingPolicy = new CachingPolicy();

            Loaded += (sender, args) => args.ReplaceService<DbProviderServices>(
                        (s, _) => new CachingProviderServices(s, transactionHandler, cachingPolicy));
        }
예제 #6
0
        public CachingCommand(DbCommand command, CommandTreeFacts commandTreeFacts, CacheTransactionHandler cacheTransactionHandler, CachingPolicy cachingPolicy)
        {
            Debug.Assert(command != null, "command is null");
            Debug.Assert(commandTreeFacts != null, "commandTreeFacts is null");
            Debug.Assert(cacheTransactionHandler != null, "cacheTransactionHandler is null");
            Debug.Assert(cachingPolicy != null, "cachingPolicy is null");

            _command                 = command;
            _commandTreeFacts        = commandTreeFacts;
            _cacheTransactionHandler = cacheTransactionHandler;
            _cachingPolicy           = cachingPolicy;
        }
예제 #7
0
        public CachingCommand(DbCommand command, CommandTreeFacts commandTreeFacts, CacheTransactionHandler cacheTransactionHandler, CachingPolicy cachingPolicy)
        {
            Debug.Assert(command != null, "command is null");
            Debug.Assert(commandTreeFacts != null, "commandTreeFacts is null");
            Debug.Assert(cacheTransactionHandler != null, "cacheTransactionHandler is null");
            Debug.Assert(cachingPolicy != null, "cachingPolicy is null");

            _command = command;
            _commandTreeFacts = commandTreeFacts;
            _cacheTransactionHandler = cacheTransactionHandler;
            _cachingPolicy = cachingPolicy;
        }
예제 #8
0
        public Configuration()
        {
            SetDatabaseInitializer<WindAuth.Data.DataContext>(new MigrateDatabaseToLatestVersion<WindAuth.Data.DataContext, WindAuth.Migrations.Configuration>());

            var transactionHandler = new CacheTransactionHandler(new InMemoryCache());

            AddInterceptor(transactionHandler);

            var cachingPolicy = new CachingPolicy();

            Loaded +=
              (sender, args) => args.ReplaceService<DbProviderServices>(
                (s, _) => new CachingProviderServices(s, transactionHandler,
                  cachingPolicy));
        }
예제 #9
0
 public CachingProviderServices(DbProviderServices providerServices, CacheTransactionHandler cacheTransactionHandler, CachingPolicy cachingPolicy = null)
 {
     _providerServices        = providerServices;
     _cacheTransactionHandler = cacheTransactionHandler;
     _cachingPolicy           = cachingPolicy ?? new CachingPolicy();
 }
예제 #10
0
 public CachingProviderServices(DbProviderServices providerServices, CacheTransactionHandler cacheTransactionHandler, CachingPolicy cachingPolicy = null)
 {
     _providerServices = providerServices;
     _cacheTransactionHandler = cacheTransactionHandler;
     _cachingPolicy = cachingPolicy ?? new CachingPolicy();
 }