예제 #1
0
 public ActionResult <Cruise> Edit(int id, [FromBody] Cruise editedCruise)
 {
     try
     {
         return(Ok(_cruisesService.Edit(id, editedCruise)));
     }
     catch (System.Exception err)
     {
         return(BadRequest(err.Message));
     }
 }
예제 #2
0
 public ActionResult <Cruise> Edit(string id, [FromBody] Cruise editCruise)
 {
     try
     {
         return(Ok(_CS.Edit(id, editCruise)));
     }
     catch (Exception err)
     {
         return(BadRequest(err.Message));
     }
 }
예제 #3
0
 [HttpPut("{id}")] // PUT
 public ActionResult <Cruise> Edit([FromBody] Cruise editCruise, int id)
 {
     try
     {
         editCruise.Id = id;
         return(Ok(_service.Edit(editCruise)));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
예제 #4
0
 public ActionResult <Cruise> Edit([FromBody] Cruise editData, int id)
 {
     try
     {
         editData.Id = id;
         Cruise editedCruise = _cservice.Edit(editData);
         return(Ok(editedCruise));
     }
     catch (System.Exception e)
     {
         return(BadRequest(e.Message));
     }
 }