Synchronization code

This commit is contained in:
sunkaixuan 2023-03-07 11:45:09 +08:00
parent 94bcdd56f2
commit a7fe8d48ee
2 changed files with 8 additions and 2 deletions

View File

@ -425,7 +425,8 @@ namespace SqlSugar
{
DbColumnName=fieldName,
Value=fieldValue,
PropertyName=fieldName
PropertyName=fieldName,
PropertyType=fieldValue?.GetType()
});
}
AppendSets();

View File

@ -35,7 +35,12 @@ namespace SqlSugar
public override KeyValuePair<string, List<SugarParameter>> ToSql()
{
var result= base.ToSql();
return new KeyValuePair<string, List<SugarParameter>>(result.Key.Replace("$PrimaryKey", this.SqlBuilder.GetTranslationColumnName(GetPrimaryKeys().FirstOrDefault())), result.Value);
var primaryKey = GetPrimaryKeys().FirstOrDefault();
if (primaryKey != null)
{
primaryKey = this.SqlBuilder.GetTranslationColumnName(primaryKey);
}
return new KeyValuePair<string, List<SugarParameter>>(result.Key.Replace("$PrimaryKey", primaryKey), result.Value);
}
public override long ExecuteReturnBigIdentity()