public IActionResult Put([FromBody] VehicleVO vehicle) { if (vehicle == null) { return(BadRequest()); } return(Ok(_vehicleBusiness.Update(vehicle))); }
public ActionResult Edit([FromBody] Vehicle vehicle) { try { _vehicleBusiness.Update(vehicle); } catch (Exception) { return BadRequest("Error while creating"); } return NoContent(); }
public ActionResult Update([FromBody] Vehicle vehicle) { try { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _vehicleBusiness.Update(vehicle); return(Ok()); } catch (Exception e) { return(StatusCode(500, e.Message)); } }