title: EF code first 4.1 one to many bi-directional setup
body: <p>I have the following code:</p>
  
  <pre><code>modelBuilder.Entity&lt;User&gt;().HasMany(x =&gt; x.Items).WithRequired();
  </code></pre>
  
  <p>The model looks like</p>
  
  <pre><code>public class User
  {
      public long Id { get; set; }
      public string Name { get; set; }
      public virtual ICollection&lt;Item&gt; Items { get; set; }
  }
  
  public class Item    
  {
      public long Id { get; set; }
      public string Title { get; set; }
  
      public virtual User User { get; set; }
  }
  </code></pre>
  
  <p>When EF generates the database for me I end up with two foreign keys in the Items table (User_Id and User_Id1) instead of just one. How would I configure this so only one key is created for me?</p>
  
  <p>Just for testing purposes I removed the User from the Item class and in that case the configuration works just fine and only one key is created.</p>