title: How To Define 2 FK in EF?
body: <blockquote>
    <p>I have 2 lists of <code>item</code>  in <code>user</code> i need 2 fk in item table i tried
    but it didnt work, what is wrong with the code</p>
  </blockquote>
  
  <pre><code>   public class User
          {
              [Key]
              public int id { get; set; }
  
          public List&lt;item&gt; a  { get; set; }
          public List&lt;item&gt; b { get; set; }
  
  
          public User()
          {
              a= new List&lt;item&gt;();
              b = new List&lt;item&gt;();
          }
  
      }
  
      public class item
      {
          [Key]
          public int id { get; set; }
          public string name { get; set; }
  
  
          [ForeignKey("a")]
          public long aFK { get; set; }
  
          [ForeignKey("b")]
          public long bFK { get; set; }
  
          [InverseProperty("a")]
          public virtual User a { get; set; }
  
          [InverseProperty("b")]
          public virtual User b { get; set; }
      }
  
  
  
      public class usersDB : DbContext
      {
          public DbSet&lt;User&gt; users { get; set; }
          public DbSet&lt;item&gt; items { get; set; }
      }
      public static usersDB dataBase()
      {
          return new usersDB();
      }
  
     private static void Main(string[] args)
          {        
              using (var db = dataBase())
              {
  
                  db.users.Add(new User() {id = 1});
                  db.SaveChanges();
              }
          }
  </code></pre>