예제 #1
0
        public static PaginatedResponse <T> CreateFrom <FT>(PaginatedResponse <FT> original, Func <FT, T> mapper)
        {
            var data = original.Data.Select(mapper).ToList();

            return(Create(data, original.Limit, original.Offset, original.Total));
        }
예제 #2
0
        public async static Task <PaginatedResponse <T> > CreateFromAsync <FT>(PaginatedResponse <FT> original, Func <FT, Task <T> > mapper)
        {
            var data = await Task.WhenAll(original.Data.Select(mapper));

            return(Create(data, original.Limit, original.Offset, original.Total));
        }