У меня есть много проектов в решении, которые используют bit-framework.Когда я использую много контекстов в разных проектах, у меня есть только последний репозиторий последнего модуля.
public IEnumerable<IAppModule> GetAppModules()
{
yield return this;
yield return new ModuleA();
yield return new ModuleB();
...
}
public virtual void ConfigureDependencies(IServiceCollection services,IDependencyManager dependencyManager)
{
AssemblyContainer.Current.AddAppAssemblies(typeof(ModuleA).GetTypeInfo().Assembly);
AssemblyContainer.Current.AddAppAssemblies(typeof(ModuleB).GetTypeInfo().Assembly);
...
}
В модуле AppA Module:
dependencyManager.RegisterEfCoreDbContext<ModuleAContext, SqlServerDbContextObjectsProvider>();
В модуле AppB ModuleB:
dependencyManager.RegisterEfCoreDbContext<ModuleBContext, SqlServerDbContextObjectsProvider>();