public IActionResult Delete(int id)
        {
            var albumTest = albumRepository.Obter(id);

            if (albumTest == null)
            {
                return(NotFound("Não existe album com esse id"));
            }

            albumRepository.DeletarAlbum(id);
            database.Commit();
            return(Ok());
        }
        public IActionResult Delete(int id)
        {
            var album = albumRepository.Obter(id);

            if (album == null)
            {
                return(NotFound());
            }

            var albumCadastrado = albumRepository.DeletarAlbum(id);

            contexto.SaveChanges();

            return(Ok(albumCadastrado));
        }
Пример #3
0
        public IActionResult Delete(int id)
        {
            var albumTest = albumRepository.Obter(id);

            if (albumTest == null)
            {
                return(NotFound("Não existe album com esse id"));
            }

            albumRepository.DeletarAlbum(id);

            contexto.SaveChanges();

            return(Ok());
        }
 public IActionResult Delete(int id)
 {
     albumRepository.DeletarAlbum(id);
     database.Commit();
     return(Ok());
 }
Пример #5
0
 public IActionResult Delete(int id)
 {
     albumRepository.DeletarAlbum(id);
     contexto.SaveChanges();
     return(Ok());
 }