DbContext have properties reflecting the different sets of entities in the database.
I'm using a plugin architecture using MEF and have read similar SO question answering part of my question (MEF Plugins and EF CodeFirst - How?)
But in my core app, I have multiple DbContext (derivatives) that group handfuls of entities together. e.g. SecurityDbContext
ConfigurationDbContext
.
These contexts only have a few DbSet
properties in them.
The article i referenced provides a method by which you have one central DbContext and configure the models in the plugin libraries. This would mean there is one DbContext for the whole application and plugins.
I know EF6 support multiple DbContexts per DB - so does that mean I can just create as many DbContexts as needed - including in the plugins?
I'm assuming that a DbContext can only join (in queries) to entities defined in it irrespective of whether the DbContext is for the same DB.
Any advice appreciated