protected override ICollection <string> GetCacheNames(ICacheOperationContext <CacheOperation> context) { return(new List <string>() { context.GetOperation().Name }); }
protected ICollection <ICache> GetCaches(ICacheOperationContext <CacheOperation> context, ICacheResolver cacheResolver) { var result = cacheResolver.CacheResolve(context); if (result.IsNullOrEmpty()) { throw new Exception("No cache could be resolved for '" + context.GetOperation() + "' using resolver '" + cacheResolver + "'. At least one cache should be provided per cache operation."); } return(result); }
public ICollection <ICache> CacheResolve(ICacheOperationContext <CacheOperation> context) { ICollection <string> cacheNames = GetCacheNames(context); if (cacheNames == null) { return(new List <ICache>()); } var result = new List <ICache>(); foreach (var cacheName in cacheNames) { var cache = CacheManager.GetCache(cacheName); if (cache == null) { throw new Exception("Cannot find cache name '" + cacheName + "' for " + context.GetOperation()); } result.Add(cache); } return(result); }
protected abstract ICollection <string> GetCacheNames(ICacheOperationContext <CacheOperation> context);