Beispiel #1
0
 private static void FillPage <TIn, TOut, TPageItem>(IApiMapper <TIn, TOut> mapper, PaginationParameters pagination, IEnumerable <TIn> inputItems, int totalItems, BaseCollectionPage <TPageItem> output)
     where TOut : class, TPageItem, new()
 {
     output.items.AddRange(mapper.Map(inputItems));
     output.pageSize    = pagination.per_page;
     output.itemsCount  = totalItems;
     output.currentPage = pagination.page;
 }
Beispiel #2
0
 public static void FillPage <TIn, TOut>(this IApiMapper <TIn, TOut> mapper, PaginationParameters pagination, IQueryable <TIn> inputQueryable, int totalItems, BaseCollectionPage <TOut> output)
     where TOut : class, new()
 {
     output.items.AddRange(mapper.Map(inputQueryable));
     output.pageSize    = pagination.per_page;
     output.itemsCount  = totalItems;
     output.currentPage = pagination.page;
 }
Beispiel #3
0
 public static void FillPage <TIn, TOut>(this IApiMapper <TIn, TOut> mapper, PaginationParameters pagination, IEnumerable <TIn> inputItems, int totalItems, BaseCollectionPage <TOut> output)
     where TOut : class, new()
 {
     FillPage <TIn, TOut, TOut>(mapper, pagination, inputItems, totalItems, output);
 }