diff --git a/src/ShardingCore/Core/VirtualTables/IVirtualTable.cs b/src/ShardingCore/Core/VirtualTables/IVirtualTable.cs
index 2cb27e91..cfd9cdf1 100644
--- a/src/ShardingCore/Core/VirtualTables/IVirtualTable.cs
+++ b/src/ShardingCore/Core/VirtualTables/IVirtualTable.cs
@@ -30,7 +30,7 @@ namespace ShardingCore.Core.VirtualTables
///
/// 是否启用分页配置
///
- bool EnablePagination => PaginationMetadata != null;
+ bool EnablePagination { get; }
///
/// 获取所有的物理表
diff --git a/src/ShardingCore/Core/VirtualTables/OneDbVirtualTable.cs b/src/ShardingCore/Core/VirtualTables/OneDbVirtualTable.cs
index eff6e5fd..0cf79390 100644
--- a/src/ShardingCore/Core/VirtualTables/OneDbVirtualTable.cs
+++ b/src/ShardingCore/Core/VirtualTables/OneDbVirtualTable.cs
@@ -31,6 +31,7 @@ namespace ShardingCore.Core.VirtualTables
public ShardingTableConfig ShardingConfig { get; }
public PaginationMetadata PaginationMetadata { get; }
+ public bool EnablePagination => PaginationMetadata != null;
private readonly List _physicTables = new List();
diff --git a/src/ShardingCore/EFCores/ShardingQueryCompiler.cs b/src/ShardingCore/EFCores/ShardingQueryCompiler.cs
index 5decac82..47cf2256 100644
--- a/src/ShardingCore/EFCores/ShardingQueryCompiler.cs
+++ b/src/ShardingCore/EFCores/ShardingQueryCompiler.cs
@@ -68,104 +68,12 @@ namespace ShardingCore.EFCores
#endif
-#if EFCORE2
-
- private IAsyncEnumerable AsyncEnumerableExecute(IShardingDbContext shardingDbContext, Expression query)
- {
- Type queryEntityType = query.Type.GetSequenceType();
- Type type = typeof(EnumerableQuery<>);
- type = type.MakeGenericType(queryEntityType);
- var queryable = Activator.CreateInstance(type, query);
-
- var streamMergeContextMethod = _streamMergeContextFactory.GetType().GetMethod("Create");
- if (streamMergeContextMethod == null)
- throw new ShardingCoreException("cant found IStreamMergeContextFactory method [Create]");
- var streamMergeContext = streamMergeContextMethod.MakeGenericMethod(new Type[] { queryEntityType }).Invoke(_streamMergeContextFactory, new[] { queryable, shardingDbContext });
-
-
- Type streamMergeEngineType = typeof(AsyncEnumerableStreamMergeEngine<>);
- streamMergeEngineType = streamMergeEngineType.MakeGenericType(queryEntityType);
- return (IAsyncEnumerable)Activator.CreateInstance(streamMergeEngineType, streamMergeContext);
- }
- private Task EnumerableExecuteAsync(IShardingDbContext shardingDbContext, Expression query, bool async)
- {
- Type queryEntityType;
- if (async)
- queryEntityType = typeof(TResult).GetGenericArguments()[0];
- else
- {
- queryEntityType = query.Type.GetSequenceType();
- }
- Type type = typeof(EnumerableQuery<>);
- type = type.MakeGenericType(queryEntityType);
- var queryable = Activator.CreateInstance(type, query);
-
- var streamMergeContextMethod = _streamMergeContextFactory.GetType().GetMethod("Create");
- if (streamMergeContextMethod == null)
- throw new ShardingCoreException("cant found IStreamMergeContextFactory method [Create]");
- var streamMergeContext = streamMergeContextMethod.MakeGenericMethod(new Type[] { queryEntityType }).Invoke(_streamMergeContextFactory, new[] { queryable, shardingDbContext });
-
-
- Type streamMergeEngineType = typeof(AsyncEnumerableStreamMergeEngine<>);
- streamMergeEngineType = streamMergeEngineType.MakeGenericType(queryEntityType);
- return (Task)Activator.CreateInstance(streamMergeEngineType, streamMergeContext);
- }
- private Task GenericMergeExecuteAsync(Type streamMergeEngineType, IShardingDbContext shardingDbContext, MethodCallExpression query, bool async, CancellationToken cancellationToken)
- {
- var queryEntityType = query.GetQueryEntityType();
- streamMergeEngineType = streamMergeEngineType.MakeGenericType(queryEntityType);
- var streamEngine = Activator.CreateInstance(streamMergeEngineType, query, shardingDbContext);
- var streamEngineMethod = streamMergeEngineType.GetMethod(async ? nameof(IGenericMergeResult.MergeResultAsync) : nameof(IGenericMergeResult.MergeResult));
- if (streamEngineMethod == null)
- throw new ShardingCoreException("cant found InMemoryAsyncStreamMergeEngine method [DoExecuteAsync]");
- var @params = async ? new object[] { cancellationToken } : new object[0];
- return (Task)streamEngineMethod.MakeGenericMethod(new Type[] { queryEntityType }).Invoke(streamEngine, @params);
- }
-
-
- private Task EnsureMergeExecuteAsync(Type streamMergeEngineType, IShardingDbContext shardingDbContext, MethodCallExpression query, bool async, CancellationToken cancellationToken)
- {
- streamMergeEngineType = streamMergeEngineType.MakeGenericType(query.GetQueryEntityType());
- var streamEngine = Activator.CreateInstance(streamMergeEngineType, query, shardingDbContext);
- var streamEngineMethod = streamMergeEngineType.GetMethod(async ? nameof(IEnsureMergeResult