We use auditor classes to capture data into our history tables anytime an entity is saved. In the entity class, we inject an auditor class with this override
protected override IAuditor CreateAuditor()
{
return new UiClaimAuditor();
}
Anytime an entity is updated, the following base method is called in GenericAuditor class (attached)
public override void AuditUpdateOfExistingEntity(IEntityCore entity)
{
base.AuditUpdateOfExistingEntity(entity);
}
public override void AuditDirectUpdateOfEntities(IEntityCore entity, IPredicate filter, IRelationCollection relations, int numberOfEntitiesUpdated)
{
base.AuditDirectUpdateOfEntities(entity, filter, relations, numberOfEntitiesUpdated);
}
After the recent upgrade to v5.3, the entity that is passed to the AuditDirectUpdateOfEntities is missing entity field values. For example
In the below code. When the UpdateMulti is called, the entity passed to the base auditor method(AuditDirectUpdateOfEntities) is missing values
UiClaimCollection coll = new UiClaimCollection();
PredicateExpression filter = new PredicateExpression();
filter.Add(UiClaimFields.AcctId == 13456);
filter.Add(UiClaimFields.ClaimId == 123);
UiClaimEntity entity = new UiClaimEntity();
entity.RetToWorkDt = DateTime.Now;
coll.UpdateMulti(entity, filter);
whereas, if we call the save directly on the entity, all the values are present in the entity (method - AuditUpdateOfExistingEntity).
//This works fine.
UiClaimEntity entity = new UiClaimEntity(13456, 123);
entity.RetToWorkDt = DateTime.Now;
entity.Save();
We noticed this behavior after we upgrade to v5.3. It was working fine in v4.2.
Attachments
Filename |
File size |
Added on |
Approval |
AuditorBase.cs
|
4,602 |
18-Oct-2018 23:53.45 |
Approved |