- 修复 Aop.AuditValue 与 FreeSql.Repository 主键状态管理的冲突;

This commit is contained in:
28810
2019-08-31 03:00:17 +08:00
parent 16bd3941c5
commit baf6d768a4
14 changed files with 514 additions and 52 deletions

View File

@ -68,15 +68,6 @@ namespace FreeSql.Oracle.Curd
if (colidx2 > 0) sb.Append(", ");
object val = col.GetMapValue(d);
if (col.Attribute.IsPrimary && col.Attribute.MapType.NullableTypeOrThis() == typeof(Guid) && (val == null || (Guid)val == Guid.Empty))
col.SetMapValue(d, val = FreeUtil.NewMongodbId());
if (_orm.Aop.AuditValue != null)
{
var auditArgs = new Aop.AuditValueEventArgs(Aop.AutoValueType.Insert, col, _table.Properties[col.CsName], val);
_orm.Aop.AuditValue(this, auditArgs);
if (auditArgs.IsChanged)
col.SetMapValue(d, val = auditArgs.Value);
}
if (_noneParameter)
sb.Append(_commonUtils.GetNoneParamaterSqlValue(specialParams, col.Attribute.MapType, val));
else