Ejemplo n.º 1
0
 public virtual async Task <TProject> GetFilteredAsync <TProject>(Expression <Func <TModel, bool> > filter, CancellationToken cancellationToken = default) where TProject : IModel <TKey>
 {
     return(await FilteredQuery.Where(filter).ProjectTo <TProject>().FirstOrDefaultAsync(cancellationToken));
 }
Ejemplo n.º 2
0
 public virtual async Task <ICollection <TProject> > ListFilteredAsync <TProject>(Expression <Func <TModel, bool> > expression, CancellationToken cancellationToken = default) where TProject : IModel <TKey>
 {
     return(await FilteredQuery.Where(expression).ProjectTo <TProject>().ToArrayAsync(cancellationToken));
 }
Ejemplo n.º 3
0
 public virtual async Task <IPagedList <TProject> > PagedListFilteredAsync <TProject>(Expression <Func <TModel, bool> > expression, int page = 1, int count = 20, CancellationToken cancellationToken = default)
     where TProject : IModel <TKey>
 {
     return(await FilteredQuery.Where(expression).ProjectTo <TProject>().ToPagedListAsync(count, page, cancellationToken));
 }
Ejemplo n.º 4
0
 public virtual async Task <ICollection <TModel> > ListFilteredAsync(Expression <Func <TModel, bool> > expression, CancellationToken cancellationToken = default)
 {
     return(await FilteredQuery.Where(expression).ToArrayAsync(cancellationToken));
 }