title: EF:“A dependent property in a ReferentialConstraint is mapped to a store-generated column” with Id change
body: <p>I happened with this error as title said.I search the google and can not find answer,because if i use sql to insert ,it is ok,and when I use the ef to add ,it can not work.looks at below,it is my database schema.
  <a href="https://i.stack.imgur.com/citom.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/citom.png" alt="enter image description here"></a></p>
  
  <p>when I try to Add something to good table ,the error occured.the fluent api of good seems that like this:</p>
  
  <pre><code>using ppdai.user.vip.model;
  using System;
  using System.ComponentModel.DataAnnotations.Schema;
  using System.Data.Entity.ModelConfiguration;
  using System.Data.Entity.ModelConfiguration.Configuration;
  
  namespace ppdai.user.vip.model.mapping
  {
  public class GoodsMapping: EntityTypeConfiguration&lt;Goods&gt;
  {
      public GoodsMapping()
      {
          this.Property(x =&gt; x.Id).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
          this.HasKey(x =&gt; x.Id);
  
  
          this.Property(x =&gt; x.GoodsQuantity).IsRequired();
          this.Property(x =&gt; x.GoodPrice).IsRequired();
          this.Property(x =&gt; x.GoodScore).IsRequired();
          this.Property(x =&gt; x.GoodTypeId).IsRequired();
  
          this.HasRequired(x =&gt; x.GoodType)
              .WithMany(x =&gt; x.Goods)
              .HasForeignKey(x =&gt; x.GoodTypeId);
  
  
      }
  
  }
   }
  </code></pre>
  
  <p>as a result ,good is the position of "center" table in my database ,anyone know how to solve it?</p>