Esempio n. 1
0
 public HttpResponseMessage Insert(HelpAddRequest model)
 {
     if (!ModelState.IsValid)
     {
         return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
     }
     try
     {
         ItemResponse <int> resp = new ItemResponse <int>();
         resp.Item = _helpService.Insert(model);
         return(Request.CreateResponse(HttpStatusCode.OK, resp));
     }
     catch (Exception ex)
     {
         return(Request.CreateResponse(HttpStatusCode.BadRequest, ex));
     }
 }