Наследование: IHttpRequestDispatcherAction
        public IHttpRequestDispatcherAction HandlePost(string uri)
        {
            if (uri == null) throw new ArgumentNullException(nameof(uri));

            var action = new HttpRequestDispatcherAction(HttpMethod.Post, uri);
            _handlers.Add(action);

            return action;
        }
Пример #2
0
 private void InvokeHandlerAction(HttpRequestDispatcherAction handler, HttpContext context)
 {
     try
     {
         handler.Handler(context);
     }
     catch (BadRequestException)
     {
         context.Response.StatusCode = HttpStatusCode.BadRequest;
     }
 }
Пример #3
0
        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);
        }
 private void InvokeHandlerAction(HttpRequestDispatcherAction handler, HttpContext context)
 {
     try
     {
         handler.Handler(context);
     }
     catch (BadRequestException)
     {
         context.Response.StatusCode = HttpStatusCode.BadRequest;
     }
 }