c# - Entity Framework Self referencing 1 to 1 optional relationship -
So I have a table called contact and it can be of different types. And I want to have one-one, one-many or one-zero / one relationship in the table in itself. Is this possible? And if so, how? For example, a contact may have a husband or wife, which is just another contact in the database. The contact can also be a type of organization, in this case there may be many relationships from one contact with other contacts. This is what I am doing in the domain class. I need to know how to properly map in embedded editing () in context. Any help would be appreciated. There is something wrong here. If an organization is a husband of a contact and a contact then an organization has a husband? I think that you need a Contactbase class: But on the second thought you might want to switch to a graph database because it looks like your description nodes and relationships. Hope that helps! Public Relations (Public Relations) {Public Intinnate {Receive; Set;} ... public life spouses {receive; Set;} public virtual contact life partner {receives; Set;} public in OrgId {get; Set;} Public Virtual Contact Organization {get; Set;} Private Icicle & Lt; Contacts & gt; _individuals; Public virtual iconenging & lt; Contacts & gt; Set Individuals {{Returns _ Indies;} {_individuals = value; }} ...}}
Public class contacts {int contactId icon & lt; Contacts & gt; Contact EntityTypeEnum EntityType}
Comments
Post a Comment