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