Пример #1
0
        public async Task <IEnumerable <Album> > GetAlbumsWithPhotosByUserId(int userId)
        {
            // Get Albums
            var consumeAlbums = await _consumeService.GetAlbumsByUserId(userId);

            // Get Photos
            var consumePhotos = await _consumeService.GetPhotosByAlbumIds(consumeAlbums.Select(album => album.Id).ToList());

            var albums = _mapper.Map <ICollection <Album> >(consumeAlbums);
            var photos = _mapper.Map <ICollection <Photo> >(consumePhotos);

            return(MergeAlbumsAndPhotos(albums, photos));
        }
 public async Task <IEnumerable <Album> > GetAlbumsByUserIdAsync(int userId)
 {
     return(await apiClient.GetAlbumsByUserId(userId));
 }