dotnet-dynamic-query/PoweredSoft.DynamicQuery.Test/MockQueryExecutionOptionsInterceptor.cs
2021-08-13 13:10:15 -04:00

23 lines
659 B
C#

using Microsoft.EntityFrameworkCore.Query;
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;
}
}
}
}