private async Task Init()
        {
            var albumLists = await _albumListService.Get <List <AlbumList> >(new AlbumListSearchRequest()
            {
                UserId = UserId, AlbumListType = "Public"
            });

            var thisUser = await _userService.GetById <UserProfile>(UserId);

            foreach (var item in albumLists)
            {
                var numberofalbums = await _albumListAlbumService.Get <List <AlbumListAlbum> >(new AlbumListAlbumSearchRequest()
                {
                    AlbumListId = item.AlbumListId
                });

                AlbumListHelperVM local = new AlbumListHelperVM()
                {
                    AlbumListId     = item.AlbumListId,
                    AlbumListName   = item.AlbumListName,
                    ListDateCreated = item.ListDateCreated,
                    UserId          = thisUser.UserId,
                    Username        = thisUser.Username,
                    NumberOfAlbums  = "Number of albums: " + numberofalbums.Count.ToString()
                };
                AlbumLists.Add(local);
            }
            FeaturedAlbumLists = "Featured Album Lists by: " + thisUser.Username;
        }
コード例 #2
0
 private void Search(string searchQuery)
 {
     AlbumLists.Clear();
     foreach (var item in AllAlbumLists)
     {
         if (item.AlbumListName.ToLower().Contains(searchQuery.ToLower()))
         {
             AlbumLists.Add(item);
         }
     }
 }
コード例 #3
0
        private async Task Init()
        {
            var returned = await _albumListService.Get <List <AlbumList> >(new AlbumListSearchRequest()
            {
                UserId = APIService.loggedProfile.UserId
            });

            returned.Remove(returned.Where(a => a.AlbumListName == "Liked Albums").FirstOrDefault());
            foreach (var item in returned)
            {
                var tracks = await _albumListAlbumService.Get <List <AlbumListAlbum> >(new AlbumListAlbumSearchRequest()
                {
                    AlbumListId = item.AlbumListId
                });

                if (tracks.Where(a => a.AlbumId == ThisAlbumId).FirstOrDefault() == null)
                {
                    AllAlbumLists.Add(item);
                    AlbumLists.Add(item);
                }
            }
        }