public void DeleteArtist(int artistId) { if (artistLookupDictionary.ContainsKey(artistId)) { ArtistModel modelToRemove = artistLookupDictionary[artistId]; AllArtists.Remove(modelToRemove); artistLookupDictionary.Remove(artistId); } DatabaseManager.Current.DeleteArtist(artistId); }
public virtual void DeleteArtistForAlbum(ArtistForAlbum artistForAlbum) { if (!artistForAlbum.Album.Equals(this)) { throw new ArgumentException("Artist is not attached to album", "artistForAlbum"); } AllArtists.Remove(artistForAlbum); if (artistForAlbum.Artist != null) { artistForAlbum.Artist.AllAlbums.Remove(artistForAlbum); } UpdateArtistString(); }