When you have a single abstraction IAbstractDbContext
it implies that all implementations are interchangable. However, it's very unlikely that you will be able to swap them, since some consumers expect to work with the Employees data model, while others expect to work with the Marketing model. Because of this you are violating the Liskov substitution principle.
Instead you should define an abstraction per model. For instance: IEmployeesDbContext
, IAccountingDbContext
and IMarketingDbContext
. Doing this resolves the ambiguity in your design that is causing you trouble. This makes it much easier to understand what data model a consumer needs, and allows you to simplify the registration process, since you don't need any conditional registrationd anymore.