title: Entity Framework Code First Foreign Key issue
body: <p>It seems to me like the <code>ForeignKey</code> attribute is not working for me, but I guess I'm using it wrong ;)</p>
  
  <p>It's easier to explain with code:</p>
  
  <pre><code>public class BaseCard
  {
      public int Id {get ; set; }
      public int BaseCardId { get; set; }
  
      public List&lt;Skill&gt; Skills { get; set; }
  }
  
  public class Skill
  {
      public int Id { get; set; }
  
      public int BaseCardId { get; set; }
      [ForeignKey("BaseCardId")]
      public BaseCard BaseCard { get; set; }
  }
  </code></pre>
  
  <p>When I try to fill these objects with the seed method, I'm getting this error:</p>
  
  <blockquote>
    <p>INSERT statement conflicted with the FOREIGN KEY constraint "FK_dbo.Skills_dbo.BaseCards_BaseCardId". The conflict occurred in database "Database", table "dbo.BaseCards", column 'Id'.</p>
  </blockquote>
  
  <p>It seems to me like the <code>ForeignKey</code> in <code>Skill</code> tries to point at the <code>Id</code> column of <code>BaseCards</code> instead of the <code>BaseCardId</code> column, and I can't figure out why..</p>
  
  <p>If I try to remove the "normal" <code>Id</code> property of <code>BaseCard</code>, and set the <code>BaseCardId</code> as the PK (with attribute <code>[Key]</code>), I get the following error:</p>
  
  <blockquote>
    <p>Store update, insert, or delete statement affected an unexpected number of rows (0). Entities may have been modified or deleted since entities were loaded. Refresh ObjectStateManager entries.</p>
  </blockquote>
  
  <p>Does anyone know how I can get this code to work so the property <code>BaseCardId</code> from the <code>Skill</code> class will point to the <code>BaseCardId</code> property of <code>BaseCard</code>, instead of apparently the <code>Id</code> property?</p>
  
  <p>Thanks in advance!</p>