Example #1
0
        public async Task <IActionResult> DeletePokemon(int id)
        {
            try
            {
                Pokemon pokemon = await _repository.GetOne(id);

                if (pokemon == null)
                {
                    return(NotFound());
                }
                await _repository.Remove(id);

                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            return(View());
        }