示例#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));
     }
 }