dotnet-dynamic-query/PoweredSoft.DynamicQuery.Core/IQueryHandler.cs

26 lines
1.0 KiB
C#
Raw Normal View History

2018-10-17 22:14:21 -04:00
using System;
using System.Linq;
using System.Text;
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
{
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
}
public interface IQueryHandlerAsync : IInterceptableQueryHandler
2018-10-18 21:52:05 -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
}