public IActionResult Delete(int id)
        {
            Anime anime = _animeRepository.GetAnime(id);

            if (anime == null)
            {
                return(View("404Error"));
            }

            _animeRepository.DeleteAnime(id);
            return(RedirectToAction("Panel", "Account"));
        }
Exemplo n.º 2
0
        //DELETE ANIME BY NAME

        public async Task <string> DeleteAnime(string name)
        {
            try
            {
                Anime checkIfExists = await _animeRepository.GetAnimeByName(name);

                if (checkIfExists == null)
                {
                    return("The record doesn't exist!");
                }

                await _animeRepository.DeleteAnime(name);

                return(name);
            }
            catch (System.Exception ex)
            {
                throw ex;
            }
        }