예제 #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());
        }
예제 #2
0
 public virtual Task OnSent(TypedSentContext context)
 {
     return(Task.FromResult(true));
 }
예제 #3
0
 internal TypedSentContext(TypedSentContext context)
     : base(context)
 {
 }