// GET: Ninjas/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Ninja ninja = _repo.GetNinjaById(id.Value); if (ninja == null) { return(HttpNotFound()); } ViewBag.ClanId = new SelectList(_repo.GetClanList(), "Id", "ClanName", ninja.ClanId); return(View(ninja)); }
// GET: Ninjas/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var ninja = _repo.GetNinjaById(id.Value); if (ninja == null) { return(HttpNotFound()); } return(View(ninja)); }