关系很多很多

时间:2015-11-20 11:10:04

标签: asp.net-mvc asp.net-mvc-5 many-to-many relationship entity-relationship

我有以下表格:

  **Table Person**

    public long Id { get; set; }
    public int Number { get; set; }
    public string Name { get; set; }
    public string NameDesportivo { get; set; }
    public string Title { get; set; }
    [DataType(DataType.Date)]
    [DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)]
    public DateTime Birthdate { get; set; }

    public Nullable<int> CC { get; set; }
    public Nullable<int> NIF { get; set; }
    public Nullable<bool> Active { get; set; }
    public string Natural { get; set; }
    public string Nacionality { get; set; }       
    public string fatherName { get; set; }
    public string motherName { get; set; }
    public string street { get; set; }
    public string numberDoor { get; set; }
    public string local { get; set; }
    public string parish { get; set; }        
    public int Id_Contacto { get; set; }          


    public virtual ICollection<Contact> Contact { get; set; }
    public HabLiterarias HabLiterarias { get; set; }


   **Table ContactPerson**

     public int ContactID
     public int PersonId

   **Table ContactType**

    public long ID { get; set; }
    public string Name { get; set; }
    public Nullable<bool> Active { get; set; }
    public string UserIDModification { get; set; }
    public Nullable<System.DateTime> DataModification { get; set; }

    public virtual ICollection<Contact> Contact { get; set; }

  **Table Contact**

    public long ID { get; set; }
    public Nullable<long> ContactTypeID { get; set; }
    public string ContactValue { get; set; }


    public virtual ContactType ContactType { get; set; }
    public virtual ICollection<Person> Person { get; set; }

我想要做的是当我创建一个人在某个时间插入该人的多个联系人时:例如插入类型联系人邮件及其值和联系人类型电话及其值在表中联系。 任何人都有任何想法。谢谢

0 个答案:

没有答案