From abc98c7c299e86a9bc91cc620236d2dcf92c0825 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Tue, 1 Apr 2025 13:29:01 +0800 Subject: [PATCH] Update Subquery.ToList --- .../Abstract/QueryableProvider/QueryableHelper.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableHelper.cs b/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableHelper.cs index 6ca5badb7..1c945ee94 100644 --- a/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableHelper.cs +++ b/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableHelper.cs @@ -2352,7 +2352,13 @@ namespace SqlSugar var p = new SugarParameter[] { new SugarParameter("@p",re.Value) }; - var value = UtilMethods.GetSqlString(config.DbType, "@p", p, true); + var isNvarchar = true; + if (this.Context.CurrentConnectionConfig?.DbType == DbType.SqlServer + &&this.Context.CurrentConnectionConfig?.MoreSettings?.DisableNvarchar!=true) + { + isNvarchar = false; + } + var value = UtilMethods.GetSqlString(config.DbType, "@p", p, isNvarchar); sql = sql.Replace(re.Name, value); }