Ejemplo n.º 1
0
        public async Task <IReadOnlyList <Photo> > GetPagedPhotosAsync(PhotoListingRequest plr)
        {
            IReadOnlyList <Photo> responsePhotos = null;

            try
            {
                var albums = await _albumService.GetAlbumsAsync();

                var constraint = this.CreatePagedPhotoRepositoryConstraint(plr);
                var photos     = await _photoRepository.GetPagedPhotosAsync(constraint);

                responsePhotos = this.CreatePagedPhotoResponse(albums, photos);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(responsePhotos);
        }
Ejemplo n.º 2
0
 public static PagedPhotoConstraint CreatePagedPhotoRepositoryConstraint(this IPhotoListingService photoListingService, PhotoListingRequest plr)
 {
     return(new PagedPhotoConstraint()
     {
         Page = plr.Page,
         PageSize = plr.PageSize,
         SortOrder = plr.SortOrder,
         SearchKey = plr.SearchKey
     });
 }