Example #1
0
        public ActionResult <Auction> Update(int Id, Auction update)
        {
            if (Id != update.Id)
            {
                return(UnprocessableEntity());
            }

            return(Ok(dao.Update(Id, update)));
        }
Example #2
0
        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));
        }
Example #5
0
        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));
            }
        }
Example #7
0
        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));
        }