title: Creating new table with foreign key with Entity Framework Core
body: <p>I have a <code>DbContext</code> which I via the developer command prompt and creating a migrations schema turn in to my database. But if you look at the product object I have a dictionary object named <code>Parts</code>. That property does not get added to the <code>Product</code> table when the database is updated in the command prompt. I don't even know if it is possible what I am trying to do.</p>
  
  <p>I want to add a table in the database named <code>Parts</code> and then add a foreign key to the <code>Product</code> table which connects the <code>Parts</code> dictionary object in the <code>Product</code> table, and the the new <code>Parts</code> table. Is this possible with Entity Framework Core?</p>
  
  <pre><code>public class ShoppingDbContext : IdentityDbContext&lt;User&gt;
  {
      public ShoppingDbContext(DbContextOptions options) : base(options)
      {
      }
  
      protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
      {
          base.OnConfiguring(optionsBuilder);
      }
  
      public DbSet&lt;Product&gt; Products { get; set; }
      public DbSet&lt;Order&gt; Orders { get; set; }
  }
  
  public class Product 
  {
      public int ProductId { get; set; }
      public string ProductName { get; set; }
      public double Price { get; set; }
      public int CategoryId { get; set; }
      Dictionary&lt;string, Part&gt; Parts { get; set; }
  }
  </code></pre>