Ejemplo n.º 1
0
        public async Task <Modifiable> OnResult(ITypedBuilderContext context, HttpRequestMessage request, HttpResponseMessage response, object result)
        {
            TypedResultContext handlerContext = null;

            foreach (var handlerInfo in GetHandlerInfo(HandlerType.Result))
            {
                if (handlerContext == null)
                {
                    handlerContext = ((Func <ITypedBuilderContext, HttpRequestMessage, HttpResponseMessage, object, TypedResultContext>)handlerInfo.InitialConstructor)(context, request, response, result);
                }
                else
                {
                    handlerContext = ((Func <TypedResultContext, TypedResultContext>)handlerInfo.ContinuationConstructor)(handlerContext);
                }

                await handlerInfo.Handler(handlerContext);
            }

            return(handlerContext?.GetHandlerResult());
        }
Ejemplo n.º 2
0
 public virtual Task OnResult(TypedResultContext context)
 {
     return(Task.FromResult(true));
 }
 internal TypedResultContext(TypedResultContext context)
     : base(context)
 {
 }