2018-12-07 00:10:33 -05:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Linq.Expressions;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace PoweredSoft.Data.Core
|
|
|
|
|
{
|
2019-02-13 21:01:47 -05:00
|
|
|
|
public interface IAsyncQueryableService
|
2018-12-07 00:10:33 -05:00
|
|
|
|
{
|
2019-02-13 23:01:38 -05:00
|
|
|
|
IEnumerable<IAsyncQueryableHandlerService> Handlers { get; }
|
|
|
|
|
|
2019-02-13 21:01:47 -05:00
|
|
|
|
IAsyncQueryableHandlerService GetAsyncQueryableHandler<T>(IQueryable<T> queryable);
|
|
|
|
|
|
2018-12-07 00:10:33 -05:00
|
|
|
|
Task<T> FirstOrDefaultAsync<T>(IQueryable<T> queryable, CancellationToken cancellationToken = default(CancellationToken));
|
|
|
|
|
Task<T> FirstOrDefaultAsync<T>(IQueryable<T> queryable, Expression<Func<T, bool>> predicate, CancellationToken cancellationToken = default(CancellationToken));
|
|
|
|
|
Task<List<T>> ToListAsync<T>(IQueryable<T> queryable, CancellationToken cancellationToken = default(CancellationToken));
|
|
|
|
|
Task<int> CountAsync<T>(IQueryable<T> queryable, CancellationToken cancellationToken = default(CancellationToken));
|
|
|
|
|
Task<long> LongCountAsync<T>(IQueryable<T> queryable, CancellationToken cancellationToken = default(CancellationToken));
|
2019-02-13 21:01:47 -05:00
|
|
|
|
Task<bool> AnyAsync<T>(IQueryable<T> queryable, Expression<Func<T, bool>> predicate, CancellationToken cancellationToken = default(CancellationToken));
|
|
|
|
|
Task<bool> AnyAsync<T>(IQueryable<T> queryable, CancellationToken cancellationToken = default(CancellationToken));
|
2018-12-07 00:10:33 -05:00
|
|
|
|
}
|
|
|
|
|
}
|