【发布时间】:2014-02-19 23:17:08
【问题描述】:
得到这个:
System.Collections.Generic.HashSet`1[Counter]
期待这个:
ICollection<Counter>
//底层对象:
public virtual ICollection<Counter> Counters { get; private set; }
我正在使用 DevExpress PropertyGridControl:
dxprg:CollectionDefinition Path="Counters" Type="{x:Type efo:Counter}"
考虑到我没有在计数器集合上调用任何函数,例如 ToList(),我认为这是 EF 的正常行为,但由于 CollectionDefenition 上的 Path 属性,不清楚如何执行此操作。 我可以创建一个实时对象,用相等的值填充它,初始化集合,然后绑定到它,但这看起来真的很脏。
欢迎任何关于 EF 正在发生的事情的智慧..
【问题讨论】:
标签: ef-code-first devexpress entity-framework-4.1 hashset