From 2c37a364bb945f6fb504bf330d885e4e82eb9c54 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Sun, 18 Sep 2022 14:46:27 +0800 Subject: [PATCH] Update nav query --- .../Abstract/QueryableProvider/NavigatManager.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/NavigatManager.cs b/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/NavigatManager.cs index ee15472c3..ebfcf4f06 100644 --- a/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/NavigatManager.cs +++ b/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/NavigatManager.cs @@ -529,10 +529,13 @@ namespace SqlSugar { //var x=method.Arguments[1]; var conditionals = ExpressionTool.GetExpressionValue(method.Arguments[1]) as List; - var whereObj = queryable.QueryBuilder.Builder.ConditionalModelToSql(conditionals); - where.Add(whereObj.Key); - if(whereObj.Value!=null) - result.Parameters.AddRange(whereObj.Value); + if (conditionals.Count > 0) + { + var whereObj = queryable.QueryBuilder.Builder.ConditionalModelToSql(conditionals); + where.Add(whereObj.Key); + if (whereObj.Value != null) + result.Parameters.AddRange(whereObj.Value); + } } else {