- 增加 Aop.AuditValue 事件,在插入/更新数据时审计属性值;

This commit is contained in:
28810
2019-08-25 18:13:02 +08:00
parent baa6c413a0
commit b57d35ae9b
12 changed files with 344 additions and 9 deletions

View File

@ -70,6 +70,13 @@ namespace FreeSql.Oracle.Curd
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.Value != null)
col.SetMapValue(d, val = auditArgs.Value);
}
if (_noneParameter)
sb.Append(_commonUtils.GetNoneParamaterSqlValue(specialParams, col.Attribute.MapType, val));
else