public CachingMdmEntityService(IMdmEntityService <TContract> service) { this.service = service; this.mappings = new Dictionary <MdmId, int>(); this.entities = new Dictionary <int, TContract>(); this.etags = new Dictionary <int, string>(); this.syncLock = new object(); this.entityName = typeof(TContract).Name; }
/// <summary> /// Create a new instance of the <see cref="CachePolicyMdmEntityService{T}" /> class. /// </summary> /// <param name="service"></param> /// <param name="cacheItemPolicyFactory"></param> public CachePolicyMdmEntityService(IMdmEntityService <TContract> service, ICacheItemPolicyFactory cacheItemPolicyFactory, IMdmClientCacheRepository mdmCacheRepository, uint version = 0) { this.service = service; this.cacheName = typeof(TContract).GetCacheNameFromEntityType(version); this.cacheRepository = mdmCacheRepository; this.cache = cacheRepository.GetNamedCache(cacheName); this.searchCache = cacheRepository.GetNamedCache("MDMSearchResultsCache"); this.cacheItemPolicyFactory = cacheItemPolicyFactory; this.etags = new Dictionary <int, string>(); this.syncLock = new object(); this.entityName = typeof(TContract).Name; this.contractVersion = version; }