suggestion: using inheritance rules on audit records

May 15, 2011 at 4:00 PM

say i have a 'customer' class  that derives from a 'Person' class.

when examining audit records for customer  object it would be nice

if i could also get audit  values for the properties from its parent class. 

example 
foreach
(CustomerAudit customerAudit in auditedCustomer.GetAuditRecords())
{
Console.WriteLine("AuditDate: " + customerAudit.AuditDate.ToString());
Console.WriteLine("AuditType: " + customerAudit.AuditType.ToString());
Console.WriteLine("CustomerId: " + customerAudit.CustomerId.ToString());
Console.WriteLine("Name: " + customerAudit.Name);
Console.WriteLine("ModifiedBy: " + customerAudit.ModifiedBy);
}


Currently it only returns properties from the bound table in the database.
obviously, I could write some code that examines the inheritance tree and gets them.
But it would be a nice addition to follow the same OO principles as normal entities follow.

Giannis



Coordinator
May 21, 2011 at 7:10 PM

This is not very easy. The reason the entire inheritance object is not returned is that there are 2 (or more) tables of course but more directly the triggers that are used to copy the data state is per table. We have not come up with a good way to guarantee that the multi-table data states are consistent inside of a transaction. This may be worked out but it will not be for a while.