public ActionResult <Auction> Update(int Id, Auction update) { if (Id != update.Id) { return(UnprocessableEntity()); } return(Ok(dao.Update(Id, update))); }
public ActionResult <Auction> Update(Auction auction, int id) { Auction existing = dao.Get(id); if (existing == null) { return(NotFound("Auction not found")); } Auction result = dao.Update(id, auction); return(Ok(result)); }
public ActionResult <Auction> Update(int id, Auction auction) { Auction existingAuction = _dao.Get(id); if (existingAuction == null) { return(NotFound("Auction does not exist")); } Auction result = _dao.Update(id, auction); return(Ok(result)); }
public ActionResult <Auction> Update(Auction auctionToUpdate, int id) { Auction existingAuction = dao.Get(id); if (existingAuction == null) { return(NotFound("Auction does not exist. Try Again?")); } Auction result = dao.Update(auctionToUpdate.Id.Value, auctionToUpdate); return(Ok(result)); }
public ActionResult <Auction> UpdateAuction(int id, Auction auctionToUpdate) { Auction auction = dao.Get(id); if (auction == null) { return(NotFound("Auction Not Found")); } else { return(Ok(dao.Update(id, auctionToUpdate))); } }
public ActionResult <Auction> Update(Auction updatedAuction, int id) { Auction existingId = dao.Get(id); if (existingId == null) { return(NotFound("Requested ID does not exist.")); } else { Auction auction = dao.Update(id, updatedAuction); return(Ok(auction)); } }
public ActionResult <Auction> UpdateAuction(int id, Auction auction) { Auction auctionUpdate = dao.Get(id); if (auction.Id == null) { return(BadRequest()); } if (auctionUpdate == null) { return(NotFound($"Auction id {id} doesn't exist")); } Auction result = dao.Update(id, auction); return(Ok(result)); }