Ejemplo n.º 1
0
 public IHttpActionResult PostProblem(int id, [FromBody] Problem problem)
 {
     try
     {
         ProblemManager manager = new ProblemManager();
         problem.customer.id = id;
         Problem result = manager.Insertar(problem);
         if (result != null)
         {
             return(Created(new Uri(Url.Link(ViewRouteName, new { id = result.customer.id })), result));
         }
         else
         {
             return(BadRequest());
         }
     }
     catch (Exception e)
     {
         return(NotFound());
     }
 }