public void Initialize() { FulcrumApplicationHelper.UnitTestSetup(typeof(TestAutoCacheManyToOneRecursive).FullName); _storage = new ManyToOneMemory <ItemWithParentId, Guid>(item => item.ParentId); Cache = new MemoryDistributedCache(); DistributedCacheOptions = new DistributedCacheEntryOptions { AbsoluteExpirationRelativeToNow = TimeSpan.FromMilliseconds(1000) }; AutoCacheOptions = new AutoCacheOptions { AbsoluteExpirationRelativeToNow = DistributedCacheOptions.AbsoluteExpirationRelativeToNow }; _autoCache = new ManyToOneAutoCache <ItemWithParentId, Guid>(_storage, Cache, null, AutoCacheOptions); }
public void Initialize() { FulcrumApplicationHelper.UnitTestSetup(typeof(TestAutoCacheCrud).FullName); _storage = new CrudMemory <string, string, Guid>(); Cache = new MemoryDistributedCache(); DistributedCacheOptions = new DistributedCacheEntryOptions { AbsoluteExpirationRelativeToNow = TimeSpan.FromMilliseconds(1000) }; AutoCacheOptions = new AutoCacheOptions { AbsoluteExpirationRelativeToNow = DistributedCacheOptions.AbsoluteExpirationRelativeToNow }; _autoCache = new CrudAutoCache <string, Guid>(_storage, ToGuid, Cache, null, AutoCacheOptions); }