AssociationType“Committee_Member_Contact”具有参照完整性约束,无法映射

时间:2013-03-12 21:47:54

标签: c# entity-framework

我正在获取AssociationType'Country_Member_Contact'具有参照完整性约束,无法在EDMX文件中映射。在我的数据库中,PK和FK之间没有关系。 Committee_Member表可以有多个Contact's. I have created参照约束as 'Contact是主要的,Committee_Member是从属的。

public partial class Committee_Member
{
    public byte[] Committee_Member_Id { get; set; }          
    public byte[] Contact_Id { get; set; }           
    public string Committee_Code { get; set; }
    public string External_Source_Name { get; set; }
    public Nullable<System.DateTime> External_Last_Update { get; set; }         

    public virtual Contact Contact { get; set; }
}
public partial class Contact
{
   public Contact()
   {
        this.Committee_Member_SPE = new HashSet<Committee_Member_SPE>();
   }
   public byte[] Contact_Id { get; set; }
   public string First_Name { get; set; }
   public string Last_Name { get; set; }
   ....
   public virtual ICollection<Committee_Member_SPE> Committee_Member_SPE { get; set; }
}

对此有何解决方案?

0 个答案:

没有答案