Beispiel #1
0
 public static ListModel <TOtherEntity, TRequestModel> Select <TEntity, TRequestModel, TOtherEntity>(this ListModel <TEntity, TRequestModel> res, Func <TEntity, TOtherEntity> selector)
     where TRequestModel : struct, IListGetModel
 {
     return(new ListModel <TOtherEntity, TRequestModel>
     {
         OriginalRequest = res.OriginalRequest,
         CurrentPage = res.CurrentPage,
         CurrentSort = res.CurrentSort,
         PageSize = res.PageSize,
         TotalPages = res.TotalPages,
         Entities = res.Entities.Select(selector)
     });
 }
Beispiel #2
0
 public static IListModel <TEntity> I <TEntity, TRequestModel>(this ListModel <TEntity, TRequestModel> lm)
     where TRequestModel : struct, IListGetModel
 {
     return(lm);
 }
Beispiel #3
0
 public static ListModel <TOtherEntity, TRequestModel> Map <TEntity, TRequestModel, TOtherEntity>(this ListModel <TEntity, TRequestModel> res, Func <IEnumerable <TEntity>, IEnumerable <TOtherEntity> > map)
     where TRequestModel : struct, IListGetModel
 {
     return(new ListModel <TOtherEntity, TRequestModel>
     {
         OriginalRequest = res.OriginalRequest,
         CurrentPage = res.CurrentPage,
         CurrentSort = res.CurrentSort,
         PageSize = res.PageSize,
         TotalPages = res.TotalPages,
         Entities = map(res.Entities)
     });
 }