I have following tables:
Profiles:
ProfileID (Primary Key)
ProfileName, etc.
Contacts:
ContactID (Primary Key)
ProfileFromID (Foreign Key)
ProfileToID (Foreign Key)
Message varchar(50) , etc.
Profiles could have many contact messages. So a given message will have who sent the message and to whom the message was sent.
I am having difficult time establishing relationship between the 2 tables. Its easy to connect Profile.ProfileID to Contact.ProfileIDFrom.
But I also want to connect Profile.ProfileID to Contact.ProfileIDTo
So... later on I want to query as follows in my entities...
Profile.MessageFrom would give me profile name and... Profile.MessageTo would give me profile name....
I want to be able to extract profile names both for ProfileIDFrom and ProfileIDTo.
I am not sure how to connect the 2 tables.