public IActionResult DeletePlaylist(int id) { Playlist playlist = _context.Playlists.SingleOrDefault(w => w.PlaylistId == id); _context.Remove(playlist); _context.SaveChanges(); return(RedirectToAction("Overview", "Spotify")); }
public bool RemoveSongfromPlaylist(int songId, int playlistId) { var result = db.PlaylistSong.Where(a => a.PlaylistId == playlistId && a.SongId == songId).FirstOrDefault(); if (result != null) { db.Remove(result); db.SaveChanges(); return(true); } return(false); }
public void DeletarUsuario(int id) { var usuarioCadastrado = contexto.Usuarios.FirstOrDefault(p => p.Id == id); contexto.Remove(usuarioCadastrado); }