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)); }
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)); }