public HttpRequestDispatcherAction Handle(HttpMethod method, string uri) { if (uri == null) throw new ArgumentNullException(nameof(uri)); var action = new HttpRequestDispatcherAction(method, uri); _handlers.Add(action); return action; }
private void InvokeHandlerAction(HttpRequestDispatcherAction handler, HttpContext context) { try { handler.Action(context); } catch (BadRequestException) { context.Response.StatusCode = HttpStatusCode.BadRequest; } }
private void InvokeHandlerAction(HttpRequestDispatcherAction handler, HttpContext context) { try { handler.Handler(context); } catch (BadRequestException) { context.Response.StatusCode = HttpStatusCode.BadRequest; } }
public IHttpRequestDispatcherAction HandlePatch(string uri) { if (uri == null) { throw new ArgumentNullException(nameof(uri)); } var action = new HttpRequestDispatcherAction(HttpMethod.Patch, uri); _handlers.Add(action); return(action); }