Пример #1
0
        public async Task <List <Album> > GetAlbums()
        {
            // TODO AT: Extract this into settings
            var albums = await _httpWrapper.MakeHttpCall("http://jsonplaceholder.typicode.com/albums");

            var photos = await _photosService.GetPhotos();

            var result = _mapper.MapItems(albums, photos);

            return(result);
        }
Пример #2
0
        public override async void Prepare(string parameter)
        {
            base.Prepare(parameter);

            IsBusy = true;
            var photosResponse = await _photosService.GetPhotos();

            IsBusy = false;

            if (photosResponse.IsSuccess)
            {
                PhotosCollection.AddRange(photosResponse.Results);
            }
        }
Пример #3
0
        public async Task GetPhotos()
        {
            IsLoading = true;

            var photos = await _photosService
                         .GetPhotos(Priority.Background)
                         .ConfigureAwait(false);

            CachePhotos(photos);

            IsLoading = false;

            Photos = photos;
        }
        public async Task <ActionResult> GetPhotos(int id)
        {
            List <Photo> photos = await photosService.GetPhotos(id);

            return(PartialView("_Photos", photos));
        }
Пример #5
0
        public IEnumerable <PhotoResource> GetPhotos(int vehicleId)
        {
            var photos = _photos.GetPhotos(vehicleId);

            return(Mapper.Map <IEnumerable <PhotoResource> >(photos));
        }