public ActionResult PutShelter(int id, Shelter shelter)
        {
            if (id != shelter.Id)
            {
                return(BadRequest());
            }



            try
            {
                _repository.EditShelter(id, shelter);
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ShelterExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Beispiel #2
0
 public IActionResult Edit(Shelter shelter)
 {
     if (ModelState.IsValid)
     {
         repository.EditShelter(shelter);
         TempData["message"] = "Alterado com sucesso!";
         return(RedirectToAction("List"));
     }
     else
     {
         return(View(shelter));
     }
 }