From 441f0dbca31093263903ddc9cc1c815d9c6be6b0 Mon Sep 17 00:00:00 2001 From: xuejiaming <326308290@qq.com> Date: Wed, 19 Oct 2022 22:31:09 +0800 Subject: [PATCH] [#209] --- .../MergeContexts/QueryableRewriteEngine.cs | 9 +++++++++ .../Sharding/ParseEngines/ParseEngine.cs | 15 --------------- 2 files changed, 9 insertions(+), 15 deletions(-) delete mode 100644 src/ShardingCore/Sharding/ParseEngines/ParseEngine.cs diff --git a/src/ShardingCore/Sharding/MergeContexts/QueryableRewriteEngine.cs b/src/ShardingCore/Sharding/MergeContexts/QueryableRewriteEngine.cs index cf848b6d..88ce737d 100644 --- a/src/ShardingCore/Sharding/MergeContexts/QueryableRewriteEngine.cs +++ b/src/ShardingCore/Sharding/MergeContexts/QueryableRewriteEngine.cs @@ -59,6 +59,15 @@ namespace ShardingCore.Sharding.MergeContexts var orders = orderByContext.PropertyOrders; var combineQueryable = mergeQueryCompilerContext.GetQueryCombineResult().GetCombineQueryable(); + + if (skip is < 0) + { + throw new ShardingCoreException($"queryable:{mergeQueryCompilerContext.GetQueryCombineResult().GetQueryCompilerContext().GetQueryExpression().ShardingPrint()} skip should >= 0"); + } + if (take is < 0) + { + throw new ShardingCoreException($"queryable:{mergeQueryCompilerContext.GetQueryCombineResult().GetQueryCompilerContext().GetQueryExpression().ShardingPrint()} take should >= 0"); + } //去除分页,获取前Take+Skip数量 var reWriteQueryable = combineQueryable; if (take.HasValue || skip.HasValue) diff --git a/src/ShardingCore/Sharding/ParseEngines/ParseEngine.cs b/src/ShardingCore/Sharding/ParseEngines/ParseEngine.cs deleted file mode 100644 index 0138bc5c..00000000 --- a/src/ShardingCore/Sharding/ParseEngines/ParseEngine.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; - -/* -* @Author: xjm -* @Description: -* @Date: DATE TIME -* @Email: 326308290@qq.com -*/ -namespace ShardingCore.Sharding.ParseEngines -{ - public class ParseEngine - { - - } -} \ No newline at end of file