0
的設置: 的EntityFramework POCO與代理(+惰性加載)的EntityFramework拋出AmbiguousMatchException
Component
和Part
類都實現IDataErrorInfo
(如果這是需要的話)。下面的代碼拋出異常:
// Context is a singleton here
Context.LoadProperty<Part>(
partEntity,
(e) => e.ChildComponents,
MergeOption.OverwriteChanges);
模棱兩可的屬性ChildComponents
我可以告訴尚沒有其他財產具有相同的名稱,它唯一的定義是:
public virtual ICollection<Component> ChildComponents { get; set; }
這在EF覆蓋代理和變成類似的東西
public virtual EntityCollection<Component> ChildComponents { get; set; }
然而,這個問題剛剛出現,我不明白爲什麼現在,因爲沒有真正的變化。
就我而言,我的一個實體具有與關聯屬性名稱相同的標量屬性,只有一個不同的外殼。這導致了'AmbiguousMatchException'。 – Steven 2014-03-18 09:58:16