title: Using both many-to-many and one-to-many to same entity
body: <p>I have a many-to-many association in EF Code-First (as explained in <a href="https://stackoverflow.com/questions/4251794/how-to-have-many-to-many-association-in-entity-framework-code-first">this</a> question), and I want to use a one-to-many to the same entity as well. The problem is EF does not produce the right database scheme. Code:</p>
  
  <pre><code>public class A
  {
    public int Id { get; set; }
    public string Name { get; set; }
    public virtual ICollection&lt;B&gt; ObjectsOfB { get; set; }
  }
  
  public class B
  {
    public int Id { get; set; }
    public virtual A ObjectA { get; set; }
    public virtual ICollection&lt;A&gt; OtherObjectsOfA { get; set; }
  }
  </code></pre>
  
  <p>When I remove the ObjectA property of class B the many-to-many association is generated correctly.
  When generated incorrectly, entity B gets 2 foreign keys to A, and entity A gets 1 foreign key to B (like a many-to-one relation).</p>