2
我有一個暴露相同類型的子集合的實體。實體本身可以是另一個實例的孩子 - 實際上是與其自身的多對多關係。在數據庫中,我有一個包含兩列的鏈接器表 - parentId和childId - 它們都引用實體表中的Id列。實體框架正確識別它與本身許多一對多的關係,但將引發一個錯誤:如何在實體框架中實現從實體到自身的多對多關聯?
Problem in Mapping Fragments starting at lines 249, 300: Two entities with possibly different keys are mapped to the same row. Ensure these two mapping fragments map both ends of the AssociationSet to the corresponding columns
任何想法如何,我可以做到這一點?
您的主鍵設置如何? – bendewey 2008-12-21 17:08:32