public void LoadSongs(string search) { if (!string.IsNullOrWhiteSpace(search)) { // SongsInQueue = (_mediaDb.FetchSongs(search); SongsInQueue.AddRange(_mediaDb.FetchSongs(search)); } else { throw new NullReferenceException("LoadSongs: search string is null empty"); } }
public void LoadSongs(string search) { if (string.IsNullOrWhiteSpace(search)) { throw new NullReferenceException(); } mediaDatabase.OpenConnection(); List <ISong> fetchedSongs = mediaDatabase.FetchSongs(search); SongsInQueue.AddRange(fetchedSongs); mediaDatabase.CloseConnection(); }
public void LoadSongs(string search) { if (!String.IsNullOrEmpty(search)) { var songs = _mediaDb.FetchSongs(search); if (songs != null && songs.Count() > 0) { foreach (var song in songs) { songQueue.Add(song); } } else { throw new SearchFailedException(); } } else { throw new SearchFailedException(); } }