Synchronization code

This commit is contained in:
sunkaixuan
2023-12-29 19:15:39 +08:00
parent fb95ab9b96
commit c5c6fa036a
3 changed files with 7 additions and 1 deletions

View File

@@ -46,6 +46,10 @@ namespace SqlSugar
}
string temp = " {0} {1} {2} {3} ";
string parameterName = string.Format("{0}Condit{1}{2}", sqlBuilder.SqlParameterKeyWord, item.FieldName, index);
if (this.Context?.CurrentConnectionConfig?.MoreSettings?.MaxParameterNameLength > 0&& parameterName.Length> this.Context?.CurrentConnectionConfig?.MoreSettings?.MaxParameterNameLength)
{
parameterName = string.Format("{0}Condit{1}{2}", sqlBuilder.SqlParameterKeyWord,item.FieldName.GetHashCode().ToString().Replace("-", ""), index);
}
if (parameterName.Contains("."))
{
parameterName = parameterName.Replace(".", "_");

View File

@@ -30,5 +30,6 @@ namespace SqlSugar
public bool EnableCodeFirstUpdatePrecision { get; set; }
public bool SqliteCodeFirstEnableDropColumn { get; set; }
public bool IsCorrectErrorSqlParameterName { get; set; }
public int MaxParameterNameLength { get; set; }
}
}

View File

@@ -535,7 +535,8 @@ namespace SqlSugar
SqliteCodeFirstEnableDefaultValue=it.MoreSettings.SqliteCodeFirstEnableDefaultValue,
SqliteCodeFirstEnableDescription=it.MoreSettings.SqliteCodeFirstEnableDescription,
IsCorrectErrorSqlParameterName = it.MoreSettings.IsCorrectErrorSqlParameterName,
SqliteCodeFirstEnableDropColumn=it.MoreSettings.SqliteCodeFirstEnableDropColumn
SqliteCodeFirstEnableDropColumn=it.MoreSettings.SqliteCodeFirstEnableDropColumn,
MaxParameterNameLength=it.MoreSettings.MaxParameterNameLength
},
SqlMiddle = it.SqlMiddle == null ? null : new SqlMiddle