LLBLGenPro v2.5 Final
I am using a DatabaseAuditor from the Auditing example provided. My AuditInfo table is on a separate database from the tables I want to audit and I have created a LLBLGenPro project for it using the Adapter method. This project contains the AuditInfo entity.
I have another database containing User + related tables. These are the tables I want to audit. I have created a LLBLGenPro project for this set of tables too using Adapter method.
This project contains the UserEntity.
I am using the dependency injection mechanism to inject the DatabaseAuditor so that the UserEntity will use it as the "AuditorToUse"
When the following code, runs I get an error because I am using the DataAccessAdapter of the UserEntity. During the SaveEntity(user), it tries to also save the AuditInfo entity, but it will fail because the AuditInfo entity needs a different adapter.
//make some changes to the UserEntity user
using (DataAccessAdapter adapter = new DataAccessAdapter())
{
adapter.StartTransaction(System.Data.IsolationLevel.RepeatableRead, updateLock);
adapter.SaveEntity(user);
adapter.SaveEntity(log);
adapter.Commit();
}
The motivation for doing this is that I want to put all Auditing related code as one separate dll, so that I can easily audit other databases.
Any suggestion on how I can save the AuditInfo entity, without having to put my audit tables in the same database? Thanks.