public async Task <Modifiable> OnMiss(ICacheContext context)
        {
            CacheMissContext handlerContext = null;

            foreach (var handlerInfo in GetHandlerInfo(CacheHandlerType.Miss))
            {
                if (handlerContext == null)
                {
                    handlerContext = ((Func <ICacheContext, CacheMissContext>)handlerInfo.InitialConstructor)(context);
                }
                else
                {
                    handlerContext = ((Func <CacheMissContext, CacheMissContext>)handlerInfo.ContinuationConstructor)(handlerContext);
                }

                await handlerInfo.Handler(handlerContext);
            }

            return((handlerContext ?? new CacheMissContext <object>(context)).GetHandlerResult());
        }
 public virtual Task OnMiss(CacheMissContext context)
 {
     return(Task.FromResult(true));
 }
Пример #3
0
 internal CacheMissContext(CacheMissContext context)
     : base(context)
 {
 }