void SaveAlbumEpisodes (AudioEpisode[] episodes, int albumID)
        {
            // Update related entries in the join table.
            CreateTable<AudioEpisodesToAlbum> ();
            var oldEntries = Table<AudioEpisodesToAlbum> ().Where (a => a.AlbumId == albumID).ToArray ();
            foreach (var oldEntry in oldEntries)
            {
                Delete (oldEntry);
            }
            foreach (var episode in episodes)
            {
                Insert (new AudioEpisodesToAlbum
                    {
                        AlbumId = albumID,
                        EpisodeId = episode.Id,
                    }
                );
            }

            CreateTable<AudioEpisode> ();
            foreach (var episode in episodes)
            {
                InsertOrReplace (episode);
            }
        }
Beispiel #2
0
 public static bool IsNullOrEmpty(AudioEpisode episode)
 {
     return(episode == null || episode == Empty);
 }
Beispiel #3
0
 public static bool IsNullOrEmpty (AudioEpisode episode)
 {
     return episode == null || episode == Empty;
 }