public ActionResult <BidModel> PutBid(int id, BidPutModel model) { Bid bid = mapper.Map <BidPutModel, Bid>(model); bid.ID = id; try { bidRepo.Update(bid); } catch (DbUpdateConcurrencyException) { if (!bidRepo.BidExists(bid)) { return(NotFound()); } //else // throw; } catch (DbUpdateException) { return(BadRequest()); } return(NoContent()); }