title: How to work shared database with code first
body: <p>I would like to create a system like WordPress. I will have a lot of separate projects in the system <em>(they can be NuGet package or source codes)</em>. This projects should have their own tables also has some common tables too <em>(like user table)</em>. I tried to use entity framework code first but I couldn't succeed <em>(common tables led to conflicts)</em>. What is the best practises <em>(design strategy)</em> for this kind of projects in .net core?</p>
  
  <p>I will explain with an example:
  I have 2 projects. One of them lets say A. A project has a Dbcontext like => <code>ADbContext : IdentityDbContext</code>. It's using IdentityDbContext. That's mean I will have <strong>aspnetuser</strong> table. It has also different tables too(companies, cars etc.) and this all tables generating by entity framework code first. I have a couple of migration histories.</p>
  
  <p>My other project using IdentityDbContext too => <code>FunnyNamesDbContext : IdentityDbContext</code>. It will create names with combining cars and names(I know silly but just for example).</p>
  
  <p>This FunnyNameProject need a table named as "<code>fun_generatedNames</code>" and it is responsible creation of this table. It can not work without the car table or user table(or another strategy it can be create if they do not exist). Also, you should have an access user table via FunnyNamesDbContext too(<code>generatedName.User.Email</code>)</p>
  
  <p>When I add funnynames project to my A project I will get some conflict errors about usertables are already exist.</p>
  
  <p>If still couldn't explain well. You can think like, I want to build projects which they are responsible for their own tables like aspnetuser system or WordPress plugins.</p>