public CacheContext(ICacheValidator context, IHandlerContext handlerContext) : base(context) { if (context == null) { throw new ArgumentNullException(nameof(context)); } if (handlerContext == null) { throw new ArgumentNullException(nameof(handlerContext)); } _handlerContext = handlerContext; Request = handlerContext.Request; Uri = Request?.RequestUri.Normalize(); Token = handlerContext.Token; HandlerRegister = context.HandlerRegister; ResultInspector = context.ResultInspector; RequestValidator = context.RequestValidator; ResponseValidator = context.ResponseValidator; RevalidateValidator = context.RevalidateValidator; AllowStaleResultValidator = context.AllowStaleResultValidator; }
public void Set(string key, object value, ICacheValidator validator) { Remove(key); CachedItems.Add(new CacheItem { Key = key, Value = value, Validator = validator }); }
public CacheItem() { Validator = NullCacheValidator.Instance; }
public static void Set(this ICacheManager cache, string groupKey, string key, object value, ICacheValidator validator) { GetGroup(cache, groupKey).Set(key, value, validator); }