2018-10-17 22:14:21 -04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
2018-12-06 22:24:03 -05:00
|
|
|
|
using System.Threading;
|
2018-10-17 22:14:21 -04:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace PoweredSoft.DynamicQuery.Core
|
|
|
|
|
{
|
2018-10-18 21:52:05 -04:00
|
|
|
|
public interface IInterceptableQueryHandler
|
2018-10-17 22:14:21 -04:00
|
|
|
|
{
|
|
|
|
|
void AddInterceptor(IQueryInterceptor interceptor);
|
|
|
|
|
}
|
2018-10-18 21:52:05 -04:00
|
|
|
|
|
|
|
|
|
public interface IQueryHandler : IInterceptableQueryHandler
|
|
|
|
|
{
|
2019-03-19 23:54:15 -04:00
|
|
|
|
IQueryExecutionResult<TSource> Execute<TSource>(IQueryable<TSource> queryable, IQueryCriteria criteria);
|
|
|
|
|
IQueryExecutionResult<TRecord> Execute<TSource, TRecord>(IQueryable<TSource> queryable, IQueryCriteria criteria);
|
2018-10-18 21:52:05 -04:00
|
|
|
|
}
|
|
|
|
|
|
2018-12-06 22:24:03 -05:00
|
|
|
|
public interface IQueryHandlerAsync : IInterceptableQueryHandler
|
2018-10-18 21:52:05 -04:00
|
|
|
|
{
|
2019-03-19 23:54:15 -04:00
|
|
|
|
Task<IQueryExecutionResult<TSource>> ExecuteAsync<TSource>(IQueryable<TSource> queryable, IQueryCriteria criteria, CancellationToken cancellationToken = default(CancellationToken));
|
|
|
|
|
Task<IQueryExecutionResult<TRecord>> ExecuteAsync<TSource, TRecord>(IQueryable<TSource> queryable, IQueryCriteria criteria, CancellationToken cancellationToken = default(CancellationToken));
|
2018-10-18 21:52:05 -04:00
|
|
|
|
}
|
2018-10-17 22:14:21 -04:00
|
|
|
|
}
|