Hi, I have been toying with NH for a few days and I love it! Great stuff. I am currently facing a problem for which I could not find any help online and I was hoping to get some help in here. I created a business model with some basic classes such as Person (Id, FirstName, LastName, HomeAddress and WorkAddress) and Address (City, State, Zip, Country, Line1, Line2), used by the first for the xxxAddress properties.
I am trying to create two sets of mapping files to map 2 DBs that have a very different structure.
In the 1st DB, the properties of the 2 addresses are in the MASTNAME table (=Persons table) and I've got the address mapping easily using "component".
In the 2nd DB things are more complicated. Addresses are in a different table, countries in another table and so is City. Essentially, each of the 2 addresses need to get some data from 3 tables, using an integer FK to them.
How can I populate a sub-property of a class with data coming from different tables?
Thanks a million! Alessandro Federici
|