public IActionResult Delete(string id) { (Sheep sheep, Shepard shepard, Policeman policeman) = Sheep.FindAPoliceman(id); if (sheep != null) { shepard.Policemen.Remove(policeman); //Sheep.UpdateASheep(sheep); return(PartialView("../Shepard/_ListPolicemen", sheep.Shepards)); } return(RedirectResult("Index", "Home")); }
public IActionResult Update([Bind] Policeman policeman) { (Sheep sheep, Shepard shepard, Policeman police) = Sheep.FindAPoliceman(policeman.Name); ViewBag.SheepId = sheep.Id; return(PartialView("Create", police)); }