Ejemplo n.º 1
0
        public IResultWithTotalCount <AccommodationItem> Merge(IResultWithTotalCount <AccommodationItem> master, IEnumerable <AccommodationPhoto> slave)
        {
            foreach (var photo in slave)
            {
                master.Result.First(p => p.Id == photo.AccommodationId).Photo = $"https://i.travelapi.com/hotels/{photo.Path}/{photo.Name}_l.{photo.Extension}";
            }

            return(master);
        }
Ejemplo n.º 2
0
        public static IPagedList <T> AsPagedList <T>(this IResultWithTotalCount <T> source, IPageInfo pageInfo)
        {
            if (source == null)
            {
                throw new ArgumentNullException(nameof(source));
            }
            if (pageInfo == null)
            {
                throw new ArgumentNullException(nameof(pageInfo));
            }

            return(new SimplePagedList <T>(source.Result, pageInfo.NumberOfSelectedPage, pageInfo.PageSize, source.TotalCount));
        }
Ejemplo n.º 3
0
 private IResultWithTotalCount <AccommodationItem> MergePhotos(IResultWithTotalCount <AccommodationItem> master, IEnumerable <AccommodationPhoto> slave)
 {
     return(Merger.Merge(master, slave));
 }