public ActionResult Delete(int id, HerosList hero) { try { dbContext.heros.Remove(hero); dbContext.SaveChanges(); return(RedirectToAction(nameof(Index))); } catch { return(View()); } }
public ActionResult Create(HerosList hero) { try { dbContext.heros.Add(hero); dbContext.SaveChanges(); //return RedirectToAction("Index", "Home"); return(RedirectToAction(nameof(Index))); } catch { return(View()); } }