Пример #1
0
 public IReadOnlyList <TEntity> Get(
     Expression <Func <TEntity, bool> > predicate,
     IncludingQuery <TEntity> includingQuery = null,
     OrderingQuery <TEntity> orderingQuery   = null,
     PagingQuery pagingQuery = null)
 {
     return(Queryable(predicate, includingQuery, orderingQuery, pagingQuery).ToList());
 }
Пример #2
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));
 }
Пример #3
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));
 }
Пример #4
0
 public static IQueryable <T> Paging <T>(this IQueryable <T> queryable, PagingQuery pagingQuery)
 {
     return(pagingQuery == null ? queryable : queryable.Skip(pagingQuery.Skip).Take(pagingQuery.Take));
 }