public void ProcessHttpRequest(HttpContext httpContext, IHttpEndpoint <TResponse> httpEndpoint) { TResponse response; if (httpEndpoint.BeforePerformActions != null && httpEndpoint.BeforePerformActions .Any(beforePerformAction => beforePerformAction.PrePerform(httpContext) == false)) { response = default(TResponse); } else { response = httpEndpoint.Performer.Perform(); } if (httpEndpoint.AfterPerformActions != null) { httpEndpoint.AfterPerformActions .DoUntil(afterPerformAction => afterPerformAction.PostPerform(httpContext) == false); } _responseHeadersWritter.WriteResponseHeaders(httpContext); httpEndpoint.ResponseWritter.WriteResponse(httpContext, response); }
public void Bootstrap( IHttpEndpoint <TResponse> endpoint, string routeDescription, Func <HttpContext, TResponse> perform = null, List <IPrePerformAction> prePerformActions = null, List <IPostPerformAction> postPerformActions = null, IResponseWritter <TResponse> responseWritter = null) { endpoint.HttpRequestDescriptor = new GenericRequestDescriptor { HttpMethod = _getHttpMethod, RouteDescription = routeDescription }; endpoint.ResponseWritter = responseWritter ?? _jsonResponseWritter; }
public void OnException(Exception exception, HttpContext httpContext, IHttpEndpoint httpEndpoint) { throw new NotImplementedException(); }