dotnet-dynamic-query/PoweredSoft.DynamicQuery.Test/MockQueryExecutionOptionsInterceptor.cs
2019-11-27 20:08:51 -06:00

23 lines
668 B
C#

using Microsoft.EntityFrameworkCore.Query.Internal;
using PoweredSoft.DynamicQuery.Core;
using System.Linq;
namespace PoweredSoft.DynamicQuery.Test
{
public partial class GroupInterceptorTests
{
public class MockQueryExecutionOptionsInterceptor : IQueryExecutionOptionsInterceptor
{
public IQueryExecutionOptions InterceptQueryExecutionOptions(IQueryable queryable, IQueryExecutionOptions current)
{
if (queryable.Provider is IAsyncQueryProvider)
{
current.GroupByInMemory = true;
}
return current;
}
}
}
}