I am using EntityFramework POCO + proxies + lazy loading in my project. Today I was quite surprised to see that the Transaction class has an associated Rows collection materialized in a HashSet (instead of an EntityCollection ). I need an EntityCollection to track changes to the collection.
public class Transaction { public virtual ICollection<TransactionRow> Rows { get; set; } }
However, other feature classes have an assembly associated with them, materialized in the EntityCollection .
I load Transaction through ObjectQuery , so it should be in context. A proxy server for the object is also created.
Can anyone say how the Entity Framework decides whether to use a HashSet or EntityCollection? Why do some things become HashSets?
hashset entity-framework entity-framework-4 poco
Jefim
source share