コード例 #1
0
        public async Task <List <PhotoDto> > GetAlbumPhotos(int albumId)
        {
            if (!_validator.IsValid(albumId))
            {
                throw new DataValidationException("AlbumId");
            }

            ICollection <Photo> photos = await _photoApi.GetApiCollection($"{photoEndpoint}?albumId=" + albumId);

            return(photos.Select(photo => _mapper.ToPhotoDto(photo)).ToList());
        }
コード例 #2
0
        public async Task <List <AlbumDto> > GetAlbums()
        {
            ICollection <Album> Albums = await _albumApi.GetApiCollection($"{AlbumEndpoint}");

            return(Albums.Select(album => _mapper.ToAlbumDto(album)).ToList());
        }