Open Closed

Entity history when using multiple db contexts #10796


0
MazarsDE created
  • product version 10.3
  • product type => Angular
  • product framework type => .net core

Hello, we are using multiple db contexts inside our application in order to separate different software functionalities (different modules). The original db context delivered by the template is still used for all original and predefined ZERO-template entities.

We now tried to switch on entity history which is working fine for the original db context and entities managed by it ("User", "OrganizationUnit" etc.). However, changes to entities handled by one of our additional db contexts are not tracket et all, although we have added them to the list of tracked items in EntityHistoryHelper. Is there any documentation or tutorial on how to use entity history with multiple db contexts?

Our wish is to have all tracked data inside the original db context (tables dbo.AbpEntityChanges, dbo.AbpEntityChangeSets, dbo.AbpEntityPropertyChanges) whilst the persistence of entities itself is handled in our module-specific db contexts. But we are happy about every suggestion leading to a working approach!

Many thanks!


5 Answer(s)
  • 0
    ismcagdas created
    Support Team

    Hi @MazarsDE

    Is your second DbContext inherited from AbpDbContext ?

  • 0
    MazarsDE created

    Hi, yes, our DbContexts inherit from AbpDbContext.

  • 0
    ismcagdas created
    Support Team

    Hi,

    In that case, it should be working. Is it possible to provide access to your project for us ?

    Thanks,

  • 0
    MazarsDE created

    Hi @ismcagdas,

    can you please contact me at ludwig.naegele@mazars.de in order to provide you access.

    Many thanks!

  • 0
    ismcagdas created
    Support Team

    Hi,

    Thanks, an email has been sent.