Ejemplo n.º 1
0
 public IHttpActionResult Post([FromBody] string text, [FromUri] int tripId)
 {
     if (!ModelState.IsValid)
     {
         return(BadRequest(ModelState));
     }
     try
     {
         travelService.AddFotoToTrip(text, tripId);
         return(Ok());
     }
     catch (ValidationException ex)
     {
         return(Content(HttpStatusCode.BadRequest, ex.Message));
     }
 }