public ActionResult <Trip> Edit(string id, [FromBody] Trip editTrip)
 {
     try
     {
         return(Ok(_TS.Edit(id, editTrip)));
     }
     catch (Exception err)
     {
         return(BadRequest(err.Message));
     }
 }
 public ActionResult <Trip> Edit(int id, [FromBody] Trip editedTrip)
 {
     try
     {
         return(Ok(_tripsService.Edit(id, editedTrip)));
     }
     catch (System.Exception err)
     {
         return(BadRequest(err.Message));
     }
 }
Ejemplo n.º 3
0
 [HttpPut("{id}")] // PUT
 public ActionResult <Trip> Edit([FromBody] Trip editTrip, int id)
 {
     try
     {
         editTrip.Id = id;
         return(Ok(_service.Edit(editTrip)));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Ejemplo n.º 4
0
 public ActionResult <Trip> Edit([FromBody] Trip editData, int id)
 {
     try
     {
         editData.Id = id;
         Trip editedTrip = _tservice.Edit(editData);
         return(Ok(editedTrip));
     }
     catch (System.Exception e)
     {
         return(BadRequest(e.Message));
     }
 }