Exemplo n.º 1
0
 public static PagedResult <T> ToPagedResult <T>(this IPagedList <T> collection) where T : class
 {
     return(new PagedResult <T> {
         Items = collection.ToArray(),
         TotalCount = collection.TotalCount
     });
 }
 public static TableResult ToTableResult <T>(this IPagedList <T> pagedList)
     where T : class
 {
     return(new TableResult
     {
         Total = pagedList.PageCount,
         Page = pagedList.PageNumber,
         Records = pagedList.TotalItemCount,
         Rows = pagedList.ToArray()
     });
 }
Exemplo n.º 3
0
 public DResults(IPagedList <T> list)
     : base(string.Empty, 0)
 {
     this.Data  = (IEnumerable <T>)((IList <T>)(list as T[]) ?? list.ToArray());
     this.Total = list.Total;
 }
Exemplo n.º 4
0
 public static PagedResult <T> ToPagedResult <T>(this IPagedList <T> list)
 {
     return(new PagedResult <T> {
         Items = list.ToArray(), TotalCount = list.TotalCount
     });
 }