public CachingCommandDefinition(DbCommandDefinition commandDefinition, CommandTreeFacts commandTreeFacts, CacheTransactionHandler cacheTransactionHandler, CachingPolicy cachingPolicy) { _commandDefintion = commandDefinition; _commandTreeFacts = commandTreeFacts; _cacheTransactionHandler = cacheTransactionHandler; _cachingPolicy = cachingPolicy; }
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); }
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)); }
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; }
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)); }
public CachingProviderServices(DbProviderServices providerServices, CacheTransactionHandler cacheTransactionHandler, CachingPolicy cachingPolicy = null) { _providerServices = providerServices; _cacheTransactionHandler = cacheTransactionHandler; _cachingPolicy = cachingPolicy ?? new CachingPolicy(); }