public bool Update(RentedCar car)
 {
     try
     {
         using (var u = new RentedCarBusiness())
         {
             return(u.Update(car));
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex);
         return(false);
     }
 }
Beispiel #2
0
 public IHttpActionResult Put([FromBody] RentedCar car)
 {
     try
     {
         using (var c = new RentedCarBusiness())
         {
             if (c.Update(car))
             {
                 return(Ok());
             }
             return(NotFound());
         }
     }
     catch (Exception ex)
     {
         return(BadRequest($"{ex}"));
     }
 }