Not sure how to describe this, and couldn't find anything, so here it is:

I have 2 entities, "Contact" and "Relation". "Contact" can be a person, a 
company, or something else. 
"Relation" describes a relationship between two contacts.

What is the best way to create this? On "Contact", I want a property 
"Relations" of type "Relation".

I was thinking of this example:

Contact
 - Id
 - Name
 - Relations (one-to-many to "Relation")

Relation
 - Id
 - LeftContact (one-to-one to "Contact")
 - RightContact (one-to-one to "Contact")
 - StartDate
 - EndDate (nullable)

Since the key to the contact could be in either "LeftContact" or 
"RightContact", how do I create the "Contact.Relations" property without 
having to create properties for each key?
Normally you would simply use the query: *WHERE (Contact.Id = 
Relation.LeftContactId OR Contact.Id = Relation.RightContactId)*
*
*
I hope you can understand my question, please let me know if you have any 
questions.
Thanks in advance!

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/nhusers/-/rwDKX84dPdwJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to