Hi all,
Audit log tables may be in another database altogether, and in another EDMX. I am also thinking that this EDMX is only referenced in another DomainModelAuditTrail project, away from the main DomainModel.
I am creating a backend audit trail via IEntityServerSaving. Though I can get the entities' EntityManager via EventArgs.GetEntityManager(), I am thinking of instantiating new EntityManager to create audit log entity.
This implies that each client transaction will result in new "DomainModelAuditTrailEntityManager" create just to create audit entries.
Of course, there must be try...catch in this new EntityManager's SaveChanges, any exceptions caught must be re-thrown to client to ensure that the transaction remains atomic.
There is no Dispose on entity manager to be called, and I am wondering if there is any impact on resource usage (besides clearing its cache).
Any advice will be great, thanks!
Sebastian