We have the "refreshSavedEntitiesAfterSave" parameter of the DataAccessAdapter.SaveEntityCollection set to true, but in my debugger output I do not notice that the SQL for re-fetching the entity is output to the Debug console.
Here is the code from our Auditor method:
public override void AuditUpdateOfExistingEntity(IEntityCore entity)
{
if (_updates.Count == 0)
return; //no data to show
AuditInfoEntity auditInfo = new AuditInfoEntity(Guid.NewGuid());
auditInfo.AffectedEntityType = entity.LLBLGenProEntityName;
auditInfo.AffectedEntityTypeFriendly = ((CommonEntityBase)entity).EntityTypeFriendly;
auditInfo.AffectedEntityId = ((CommonEntityBase)entity).EntityId;
auditInfo.AffectedEntityIdFriendly = Utils.Trunc(((CommonEntityBase)entity).EntityIdFriendly, 80, false);
auditInfo.ActionDateTime = DateTime.Now;
auditInfo.ActionType = (int)AuditType.Updated;
auditInfo.ActionData = GetActionData(entity, AuditType.Updated);
auditInfo.UserId = ((UsersEntity)Thread.CurrentPrincipal.Identity).UserId;
auditInfo.ParentEntityId = ((CommonEntityBase)entity).ParentEntityId;
_auditInfoEntities.Add(auditInfo);
}
The exception is being thrown in the line that attempts to resolve EntityIdFriendly, which is a custom property that formats 3 other properties from the underlying object.
-MrB