public ActionResult <CatCard> UpdateCatCard(int id, CatCard changedCard)
 {
     if (cardDAO.GetCard(id) != null)
     {
         if (changedCard.CatCardId == id)
         {
             return(Ok(cardDAO.UpdateCard(changedCard)));
         }
     }
     return(NotFound());
 }
Ejemplo n.º 2
0
        public ActionResult <Boolean> UpdateCatCard(int id, CatCard card)
        {
            CatCard location = cardDAO.GetCard(id);

            if (location == null)
            {
                return(NotFound($"CatCard id {id} doesn't exist"));
            }

            bool result = cardDAO.UpdateCard(card);

            return(result);
        }
        public ActionResult <CatCard> UpdateCard(int Id, CatCard catCard)
        {
            CatCard existing = cardDAO.GetCard(Id);

            if (existing == null)
            {
                return(NotFound("Card not found"));
            }

            bool result = cardDAO.UpdateCard(catCard);

            if (result)
            {
                return(Ok(cardDAO.GetCard(Id)));
            }
            return(null);
        }
Ejemplo n.º 4
0
 public bool UpdateCard(CatCard catCard)
 {
     return(cardDAO.UpdateCard(catCard));
 }