Ejemplo n.º 1
0
        /// <summary>
        /// Delete a single song from local and peristanet storage
        /// </summary>
        /// <param name="songToDelete"></param>
        public static void DeleteSong(Song songToDelete)
        {
            lock ( lockObject )
            {
                if (IdLookup.ContainsKey(songToDelete.Id) == true)
                {
                    SongCollection.Remove(songToDelete);
                    IdLookup.Remove(songToDelete.Id);
                    artistAlbumLookup[songToDelete.ArtistAlbumId].Remove(songToDelete);
                    albumLookup[songToDelete.AlbumId].Remove(songToDelete);
                }
            }

            DbAccess.DeleteAsync(songToDelete);
        }