Update odbc

This commit is contained in:
sunkaixuan 2024-07-27 20:00:04 +08:00
parent 4bd6218ac1
commit 39c6f2ce32

View File

@ -94,10 +94,20 @@ namespace SqlSugar.Odbc
}
public override string Contains(MethodCallExpressionModel model)
{
if (IsSqlServerModel(model))
{
return base.Contains(model);
}
var parameter = model.Args[0];
var parameter2 = model.Args[1];
return string.Format(" ({0} like '%'||{1}||'%') ", parameter.MemberName, parameter2.MemberName);
}
private static bool IsSqlServerModel(MethodCallExpressionModel model)
{
return model.Conext?.SugarContext?.Context?.CurrentConnectionConfig?.MoreSettings?.DatabaseModel == DbType.SqlServer;
}
public override string StartsWith(MethodCallExpressionModel model)
{
var parameter = model.Args[0];