public ActionResult DeleteConfirmed(int id) { PokemonLocal pokemonLocal = db.PokemonLocals.Find(id); db.PokemonLocals.Remove(pokemonLocal); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Name,Url")] PokemonLocal pokemonLocal) { if (ModelState.IsValid) { db.Entry(pokemonLocal).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(pokemonLocal)); }
public ActionResult Create([Bind(Include = "Id,Name,Url")] PokemonLocal pokemonLocal) { if (ModelState.IsValid) { db.PokemonLocals.Add(pokemonLocal); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(pokemonLocal)); }
// GET: PokemonLocals/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PokemonLocal pokemonLocal = db.PokemonLocals.Find(id); if (pokemonLocal == null) { return(HttpNotFound()); } return(View(pokemonLocal)); }