Beispiel #1
0
 private IQueryable <TEntity> Queryable(
     Expression <Func <TEntity, bool> > predicate,
     IncludingQuery <TEntity> includingQuery = null,
     OrderingQuery <TEntity> orderingQuery   = null,
     PagingQuery pagingQuery = null)
 {
     return(DbSet.Where(predicate).Including(includingQuery).Ordering(orderingQuery).Paging(pagingQuery));
 }
Beispiel #2
0
 public async Task <IReadOnlyList <TEntity> > GetAsync(
     Expression <Func <TEntity, bool> > predicate,
     IncludingQuery <TEntity> includingQuery = null,
     OrderingQuery <TEntity> orderingQuery   = null,
     PagingQuery pagingQuery             = null,
     CancellationToken cancellationToken = default)
 {
     return(await Queryable(predicate, includingQuery, orderingQuery, pagingQuery)
            .ToListAsync(cancellationToken));
 }
Beispiel #3
0
 public static IQueryable <T> Paging <T>(this IQueryable <T> queryable, PagingQuery pagingQuery)
 {
     return(pagingQuery == null ? queryable : queryable.Skip(pagingQuery.Skip).Take(pagingQuery.Take));
 }