Maik
Resolving correct DbContext depending on ???
Hey everyone, I'm building a modular application with ASP.NET 8 and using the inbox/outbox pattern for communication between modules.
Scenario:
- Module A receives an integration event.
- I want to store this event in the database using a generic IInboxRepository.
- Challenge: Each module has its own DbContext for its specific data.
How can I design my IInboxRepository to resolve the correct DbContext and save the integration event in the appropriate inbox table for the originating module?
Right now I am thinking about something like this, but I don't like it to be honest. I don't know why lol
Does anybody know how I could design this better? Or maybe someone has a complete different approach? I highly appreciate any kind of help
3 replies