private void SearchAlbums(string searchQuery) { QueryAlbums.Clear(); foreach (var item in AllAlbums) { if (item.AlbumName.ToLower().Contains(searchQuery.ToLower())) { QueryAlbums.Add(item); } } }
private async Task LoadAlbums() { var allAlbums = await _albumService.Get <List <Model.Album> >(null); foreach (var item in allAlbums) { AlbumHelperVM local = new AlbumHelperVM() { AlbumGeneratedRating = "Rating: " + item.AlbumGeneratedRating.ToString() + "/5", AlbumId = item.AlbumId, AlbumName = item.AlbumName, AlbumPhoto = item.AlbumPhoto, ArtistId = item.ArtistId, DateReleased = "Released: " + item.DateReleased }; local.ArtistName = AllArtists.Where(a => a.ArtistId == local.ArtistId).Select(a => a.ArtistName).FirstOrDefault(); AllAlbums.Add(local); QueryAlbums.Add(local); } }