title: One-To-Many and One-To-Many relationship in Entity Framework 6
body: <p>Now I have been trying for too long to make this work.</p>
  
  <p>I have three entities:</p>
  
  <pre><code>public class Item
  {
      public int ItemId { get; set; }
      public string ItemName { get; set; }
      public int StdVolume { get; set; }
      public string StdUnit { get; set; }
  
      public ICollection&lt;ListItem&gt; ListItems { get; set; } 
  }
  
  public class ListItem
  {
      public int Amount { get; set; }
      public int Volume { get; set; }
      public string Unit { get; set; }
  
      public List List { get; set; }
      public Item Item { get; set; }
  }
  
  public class List
  {
      public int ListId { get; set; }
      public string ListName { get; set; }
  
      public ICollection&lt;ListItem&gt; ListItems { get; set; } 
  }
  </code></pre>
  
  <p>As you can see I have One-To-Many between Item and ListItem, and One-To-Many between Item and ListItem.</p>
  
  <p>I feel like I have tried everything in:</p>
  
  <pre><code>protected override void OnModelCreating(DbModelBuilder modelBuilder)
  </code></pre>
  
  <p>HasKey, Required, everything. I just don't know how to "map" it around.</p>
  
  <p>Can anyone help?</p>
  
  <p>EDIT: I want ListItem to be a weak entity, therefore its PK's and FK's should be ListId and ItemId.</p>