示例#1
0
 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"));
 }
示例#2
0
 public IActionResult Update([Bind] Policeman policeman)
 {
     (Sheep sheep, Shepard shepard, Policeman police) = Sheep.FindAPoliceman(policeman.Name);
     ViewBag.SheepId = sheep.Id;
     return(PartialView("Create", police));
 }