Assume that I have Person and Address Classes and they have different tables in DB.
One Person can have one Address Class in it. This is the important part for me. One Person can have only one Address as it s child element and i want to keep them in different tables in DB.
Normally i know that i need to hold them in the same table, but my scenario needs this.
(and also it looks like a one-to-many but i dont want to have a collection just for one object)
Person Address
------- -------
id id
Name PersonId
StreetName
And class code
Person
--------
public virtual long Id{get;set;}
public virtual Address MyAddress {get;set;}
As you see i want to get Address Property in Person when i get any Person ? But they are in different tables. How can this mapping be done ?
Thanks in advance