title: Entity Framework class with list of object
body: <p>I'm using EF 6.0 and ASP.NET MVC with C# and I have two classes - <code>project</code> and <code>feature</code>:</p>
  
  <pre><code>public class project
  {
      [Key]
      [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
      public Guid id { get; set; }
  
      [Required]
      public string aliasName { get; set; }
  
      public virtual List&lt;feature&gt; features { get; set; }
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>public class feature
  {
      [Key]
      [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
      public int id { get; set; }
  
      [Required]
      public string name { get; set; }
  
      [DataType(DataType.MultilineText)]
      public string description { get; set; }
  }
  </code></pre>
  
  <p>The end-user will pick more than one feature per project, and each project can contain different features.</p>
  
  <p>How can I setup this in EF and store this selection in db?</p>
  
  <p>In <code>dbContext</code> I have at this moment:</p>
  
  <pre><code>public DbSet&lt;project&gt; Projects { get; set; }
  public DbSet&lt;feature&gt; Features { get; set; }
  </code></pre>