Update EscapeLikeValue

This commit is contained in:
sunkaixuan 2025-04-29 19:03:26 +08:00
parent 18b2b031f2
commit a755f9ffdb

View File

@ -18,8 +18,13 @@ namespace SqlSugar
{ {
public class UtilMethods 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)) if (string.IsNullOrEmpty(value))
return value; return value;