title: Entity Framework - related ICollection getting materialized into HashSet
body: <p>I use EntityFramework POCO + proxies + lazy loading in my project. Today I was pretty surprized to see that the class <code>Transaction</code> has its related collection <code>Rows</code> materialized into <code>HashSet</code> (instead of <code>EntityCollection</code>). I need <code>EntityCollection</code> for tracking changes in the collection.</p>
  
  <pre><code>public class Transaction
  {
      public virtual ICollection&lt;TransactionRow&gt; Rows { get; set; }
  }
  </code></pre>
  
  <p>However other entity classes have their related collection materialized into <code>EntityCollection</code>.</p>
  
  <p>I am loading the <code>Transaction</code> through <code>ObjectQuery</code>, so it should be in the context. The proxy for the object is also created.</p>
  
  <p>Could anyone tell - how does Entity Framework decide what to use - HashSet or EntityCollection? Why some thing become HashSets?</p>