Synchronization code

This commit is contained in:
sunkaixuan 2024-02-22 16:47:39 +08:00
parent 1de431c97a
commit f972f3ee33
4 changed files with 11 additions and 3 deletions

View File

@ -32,6 +32,6 @@ namespace SqlSugar
public bool IsCorrectErrorSqlParameterName { get; set; } public bool IsCorrectErrorSqlParameterName { get; set; }
public int MaxParameterNameLength { get; set; } public int MaxParameterNameLength { get; set; }
public bool DisableQueryWhereColumnRemoveTrim { get; set; } public bool DisableQueryWhereColumnRemoveTrim { get; set; }
public DbType? DataBaseModel { get;set; } public DbType? DatabaseModel { get;set; }
} }
} }

View File

@ -57,6 +57,14 @@ namespace SqlSugar
SetShortName(exp, result); SetShortName(exp, result);
if (result == null&& ExpressionTool.GetLambdaExpressionBody(exp.Arguments[0]) is ConstantExpression )
{
var constant = ExpressionTool.GetLambdaExpressionBody(exp.Arguments[0]) as ConstantExpression;
if (constant.Value?.ToString()?.Contains(",")==true)
{
result = string.Join(",",(constant.Value+"").Split(",").Select(it=>this.Context.GetTranslationTableName(it)));
}
}
result = this.Context.DbMehtods.GetStringJoinSelector(result, ExpressionTool.GetExpressionValue(exp.Arguments[1]) + ""); result = this.Context.DbMehtods.GetStringJoinSelector(result, ExpressionTool.GetExpressionValue(exp.Arguments[1]) + "");
return result; return result;

View File

@ -609,7 +609,7 @@ WHERE tgrelid = '" + tableName + "'::regclass");
} }
private bool IsPgModel() private bool IsPgModel()
{ {
return this.Context.CurrentConnectionConfig?.MoreSettings?.DataBaseModel == DbType.PostgreSQL; return this.Context.CurrentConnectionConfig?.MoreSettings?.DatabaseModel == DbType.PostgreSQL;
} }
#endregion #endregion
} }

View File

@ -594,7 +594,7 @@ namespace SqlSugar
SqliteCodeFirstEnableDropColumn=it.MoreSettings.SqliteCodeFirstEnableDropColumn, SqliteCodeFirstEnableDropColumn=it.MoreSettings.SqliteCodeFirstEnableDropColumn,
MaxParameterNameLength=it.MoreSettings.MaxParameterNameLength, MaxParameterNameLength=it.MoreSettings.MaxParameterNameLength,
DisableQueryWhereColumnRemoveTrim=it.MoreSettings.DisableQueryWhereColumnRemoveTrim, DisableQueryWhereColumnRemoveTrim=it.MoreSettings.DisableQueryWhereColumnRemoveTrim,
DataBaseModel=it.MoreSettings.DataBaseModel DatabaseModel=it.MoreSettings.DatabaseModel
}, },
SqlMiddle = it.SqlMiddle == null ? null : new SqlMiddle SqlMiddle = it.SqlMiddle == null ? null : new SqlMiddle