I am using Audit.Net with Entity Framework Data Provider.
I am using one database for the application data and a different database (and DbContext) for the audits.
In the core configuration, I am seetting the the explicit mapper as in this example:
config.AuditTypeExplicitMapper(m =>
{
m.Map<Client, ClientAudit>();
m.AuditEntityAction<IAuditEntity>(SetAuditEntity);
});
Everything works fine. However later on I would like to load an entity and then see all audits for that entity.
What I easily do is query the Audit context with the Id of the entity. But then I need to know before hand the mappings from my Application context to my Audit context.
What I mean is. Find that for the Client entity, the ClientAudit entity is used. Does Audit.Net offers this possibility?
I tried looking directly in the Audit.Net code and documentation, but I found nothing that would give me this direct result.
Searching online I found no similar information. Seems I am the first to try to accomplish this.