public async Task DeleteAsync(string genre) { var dbGenre = await _context.Genres .Include(x => x.AlbumGenres) .Include(x => x.ArtistGenres) .SingleOrDefaultAsync(x => x.Name == genre); _context.RemoveRange(dbGenre.ArtistGenres); _context.RemoveRange(dbGenre.AlbumGenres); _context.Remove(dbGenre); await _context.SaveChangesAsync(); }