public ActionResult Create(monster monsterModel)
 {
     using (PokemonModels pokemonModel = new PokemonModels())
     {
         pokemonModel.monsters.Add(monsterModel);
         pokemonModel.SaveChanges();
     }
     return(RedirectToAction("Index"));
 }
 public ActionResult Edit(monster monsterModel)
 {
     using (PokemonModels pokemonModel = new PokemonModels())
     {
         pokemonModel.Entry(monsterModel).State = System.Data.Entity.EntityState.Modified;
         pokemonModel.SaveChanges();
     }
     return(RedirectToAction("Index"));
 }
 public ActionResult Delete(int id, FormCollection collection)
 {
     using (PokemonModels pokemonModel = new PokemonModels())
     {
         monster monsterModel = pokemonModel.monsters.Where(x => x.id == id).FirstOrDefault();
         pokemonModel.monsters.Remove(monsterModel);
         pokemonModel.SaveChanges();
     }
     return(RedirectToAction("Index"));
 }
        // GET: Monster/Delete/5
        public ActionResult Delete(int id)
        {
            monster monsterModel = new monster();

            using (PokemonModels pokemonModel = new PokemonModels())
            {
                monsterModel = pokemonModel.monsters.Where(x => x.id == id).FirstOrDefault();
            }
            return(View(monsterModel));
        }
        // GET: Monster
        public ActionResult Index()
        {
            List <monster> monsterList = new List <monster>();

            using (PokemonModels pokemonModel = new PokemonModels())
            {
                monsterList = pokemonModel.monsters.ToList <monster>();
            }
            return(View(monsterList));
        }