This question is locked. New answers and comments are not allowed.
Hi
We're implementing a persistent audit trail which has an audit (log) table alongside each domain (business) table; each audit table has 3 columns:
- EntityID - the primary key of the domain entity instance being logged
- LockVersion - the optimistic locking version number of the domain entity instance at the time the audit record was created
- ChangeSetID - foreign key referencing the 'change set' (roughly transaction) that changed the instance.
The EntityID and LockVersion fields together are the multi-field identity for the audit object, so we need to implement an application identity class. As we will have hundreds of such classes, I wanted to implement it using a generic type, roughly:
public abstract class AuditObjectID<EntityType> : IObjectId where EntityType : DomainEntity {
...
}
but VEnhance didn't like that.
Further experiments indicate that the identity class can't use straightforward inheritance - defining the fields and required methods in a base class causes VEnhance to produce some odd errors (I can reproduce and supply the actual errors if useful, sorry I didn't keep them when I was doing the experiment).
Is this something that should work or is there a restriction that application entity classes have to be simple?
[We can live with that - we're generating this code anyway - but would prefer the more compact approach of a base class]
Best regards
Peter
We're implementing a persistent audit trail which has an audit (log) table alongside each domain (business) table; each audit table has 3 columns:
- EntityID - the primary key of the domain entity instance being logged
- LockVersion - the optimistic locking version number of the domain entity instance at the time the audit record was created
- ChangeSetID - foreign key referencing the 'change set' (roughly transaction) that changed the instance.
The EntityID and LockVersion fields together are the multi-field identity for the audit object, so we need to implement an application identity class. As we will have hundreds of such classes, I wanted to implement it using a generic type, roughly:
public abstract class AuditObjectID<EntityType> : IObjectId where EntityType : DomainEntity {
...
}
but VEnhance didn't like that.
Further experiments indicate that the identity class can't use straightforward inheritance - defining the fields and required methods in a base class causes VEnhance to produce some odd errors (I can reproduce and supply the actual errors if useful, sorry I didn't keep them when I was doing the experiment).
Is this something that should work or is there a restriction that application entity classes have to be simple?
[We can live with that - we're generating this code anyway - but would prefer the more compact approach of a base class]
Best regards
Peter