public ActionResult <Cruise> Edit(int id, [FromBody] Cruise editedCruise) { try { return(Ok(_cruisesService.Edit(id, editedCruise))); } catch (System.Exception err) { return(BadRequest(err.Message)); } }
public ActionResult <Cruise> Edit(string id, [FromBody] Cruise editCruise) { try { return(Ok(_CS.Edit(id, editCruise))); } catch (Exception err) { return(BadRequest(err.Message)); } }
[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)); } }
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)); } }