Exemplo n.º 1
0
        public async Task <Modifiable> OnSent(ITypedBuilderContext context, HttpRequestMessage request, HttpResponseMessage response)
        {
            TypedSentContext handlerContext = null;

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

                await handlerInfo.Handler(handlerContext);
            }

            return(handlerContext?.GetHandlerResult());
        }
Exemplo n.º 2
0
 public virtual Task OnSent(TypedSentContext context)
 {
     return(Task.FromResult(true));
 }
Exemplo n.º 3
0
 internal TypedSentContext(TypedSentContext context)
     : base(context)
 {
 }