title: ASP.NET Entity Framework 6 HashSet or List for a collection?
body: <p>My EF models look like this:</p>
  
  <pre><code>public class ContentStatus
  {
      public ContentStatus()
      {
          this.Contents = new List&lt;Content&gt;();
      }
  
      public int ContentStatusId { get; set; }
      public string Name { get; set; }
      public virtual ICollection&lt;Content&gt; Contents { get; set; }
  }
  </code></pre>
  
  <p>However I have also seen implementatins looking like this:</p>
  
  <pre><code>public class ContentStatus
  {
      public ContentStatus()
      {
          this.Contents = new HashSet&lt;Content&gt;();
      }
  
      public int ContentStatusId { get; set; }
      public string Name { get; set; }
      public virtual ICollection&lt;Content&gt; Contents { get; set; }
  }
  </code></pre>
  
  <p>Here is the DDL for this Object:</p>
  
  <pre><code>CREATE TABLE [dbo].[ContentStatus] (
      [ContentStatusId] INT           NOT NULL,
      [Name]            NVARCHAR (50) NOT NULL,
      CONSTRAINT [PK_ContentStatus] PRIMARY KEY CLUSTERED ([ContentStatusId] ASC)
  );
  </code></pre>
  
  <p>Can anyone tell me which I should use or even is there a difference and when would I use the List and when the HashSet if that applies. </p>
  
  <p>Thanks</p>