public static PaginatedResponse <T> CreateFrom <FT>(PaginatedResponse <FT> original, Func <FT, T> mapper) where FT : class { 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) where FT : class { var data = await Task.WhenAll(original.Data.Select(mapper)); return(Create(data, original.Limit, original.Offset, original.Total)); }