public async Task <Modifiable> OnExpiring(ICacheContext context, RequestValidationResult reason) { CacheExpiringContext handlerContext = null; foreach (var handlerInfo in GetHandlerInfo(CacheHandlerType.Expiring)) { if (handlerContext == null) { handlerContext = ((Func <ICacheContext, RequestValidationResult, CacheExpiringContext>)handlerInfo.InitialConstructor)(context, reason); } else { handlerContext = ((Func <CacheExpiringContext, CacheExpiringContext>)handlerInfo.ContinuationConstructor)(handlerContext); } await handlerInfo.Handler(handlerContext); } return((handlerContext ?? new CacheExpiringContext(context, 0)).GetHandlerResult()); }
public virtual Task OnExpiring(CacheExpiringContext context) { return(Task.FromResult(true)); }
public CacheExpiringContext(CacheExpiringContext context) : base(context) { _relatedUris = context._relatedUris; }