public IHttpActionResult CheckCar(int id, bool flag) { try { if (flag == true) { auctionService.EditCarCheck(id, flag); auctionService.Save(); return(Ok()); } if (flag == false) { auctionService.DeleteCar(id); auctionService.Save(); return(Ok()); } return(Ok()); } catch (Exception ex) { return(BadRequest(ex.ToString())); } }