From a755f9ffdb6de6b8d618bce78e8de9c327a6f84a Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Tue, 29 Apr 2025 19:03:26 +0800 Subject: [PATCH] Update EscapeLikeValue --- Src/Asp.NetCore2/SqlSugar/Utilities/UtilMethods.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Src/Asp.NetCore2/SqlSugar/Utilities/UtilMethods.cs b/Src/Asp.NetCore2/SqlSugar/Utilities/UtilMethods.cs index e32de986f..47229b3c6 100644 --- a/Src/Asp.NetCore2/SqlSugar/Utilities/UtilMethods.cs +++ b/Src/Asp.NetCore2/SqlSugar/Utilities/UtilMethods.cs @@ -18,8 +18,13 @@ namespace SqlSugar { public class UtilMethods { - public static string EscapeLikeValue(DbType dbType, string value, char wildcard='%') + public static string EscapeLikeValue(ISqlSugarClient db, string value, char wildcard='%') { + var dbType = db.CurrentConnectionConfig.DbType; + if (db.CurrentConnectionConfig?.MoreSettings?.DatabaseModel != null) + { + dbType = db.CurrentConnectionConfig.MoreSettings.DatabaseModel.Value; + } if (string.IsNullOrEmpty(value)) return value;