示例#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));
        }
        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();
 }
 public CachingProviderServices(DbProviderServices providerServices, CacheTransactionHandler cacheTransactionHandler, CachingPolicy cachingPolicy = null)
 {
     _providerServices = providerServices;
     _cacheTransactionHandler = cacheTransactionHandler;
     _cachingPolicy = cachingPolicy ?? new CachingPolicy();
 }