コード例 #1
0
 public IActionResult Put([FromBody] VehicleVO vehicle)
 {
     if (vehicle == null)
     {
         return(BadRequest());
     }
     return(Ok(_vehicleBusiness.Update(vehicle)));
 }
コード例 #2
0
 public ActionResult Edit([FromBody] Vehicle vehicle)
 {
     try
     {
         _vehicleBusiness.Update(vehicle);
     }
     catch (Exception)
     {
         return BadRequest("Error while creating");
     }
     return NoContent();
 }
コード例 #3
0
 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));
     }
 }