title: How to run migration after scaffolding database
body: <p>I have a .NET Core project using EF Core.  We already had some tables in the database, so I used EF Core scaffolding command to import all tables into my application.</p>
  
  <p>Everything went fine, I have the models built and I can use those to access database.</p>
  
  <p>Now, I want to change my models just as EF Core Code First approach.  I change my model and run a migration.</p>
  
  <p>But my migration fails with this error message:</p>
  
  <p>error CS0102: The type 'mydbContext' already contains a definition for 'Activation'</p>
  
  <p>'Activation' is table in my database. This error is thrown for <strong>every</strong> table in the database. And I am unable to run the Migration.</p>
  
  <p>My question is, what do I do to run the migration successfully and continue with Code First approach?</p>
  
  <p>I have looked at various places and Microsoft documentation. But none shows how to run migration after a successful scaffolding.</p>
  
  <pre><code>PM&gt; Add-Migration Initial -Context MyApp.Models.mydbContext
  
  error CS0102: The type 'mydbContext' already contains a definition for 
  'Activation'
  
  error CS0102: The type 'mydbContext' already contains a definition for 
  'Session'
  
  ....
  </code></pre>
  
  <p>I expect to run the migration successfully and be able to update database tables from code.</p>