From 72aa41a6326a09b5313d1fa97d9e98450668f356 Mon Sep 17 00:00:00 2001 From: sunkaixuna <610262374@qq.com> Date: Tue, 3 Aug 2021 20:19:57 +0800 Subject: [PATCH] Complex query BUG --- Src/Asp.NetCore2/SqlSeverTest/SqlSeverTest/UnitTest/UInsert.cs | 1 + .../SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Src/Asp.NetCore2/SqlSeverTest/SqlSeverTest/UnitTest/UInsert.cs b/Src/Asp.NetCore2/SqlSeverTest/SqlSeverTest/UnitTest/UInsert.cs index 6bd6c405d..0329c83fc 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/SqlSeverTest/UnitTest/UInsert.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/SqlSeverTest/UnitTest/UInsert.cs @@ -11,6 +11,7 @@ namespace OrmTest public static void Insert() { var db = Db; + db.CodeFirst.InitTables(); db.DbMaintenance.TruncateTable(); db.CodeFirst.InitTables(); db.Insertable(new List diff --git a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs index 0b206e7c8..c2f89108f 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs @@ -256,7 +256,7 @@ namespace SqlSugar resolveExpress.SqlFuncServices = Context.CurrentConnectionConfig.ConfigureExternalServices == null ? null : Context.CurrentConnectionConfig.ConfigureExternalServices.SqlFuncServices; }; resolveExpress.Resolve(expression, resolveType); - this.Parameters.AddRange(resolveExpress.Parameters); + this.Parameters.AddRange(resolveExpress.Parameters.Select(it=>new SugarParameter(it.ParameterName, it.Value))); var result = resolveExpress.Result; var isSingleTableHasSubquery = IsSingle() && resolveExpress.SingleTableNameSubqueryShortName.HasValue(); if (isSingleTableHasSubquery)