I have been trying to look for solutions to the problem that I am currently having with mapping my DDD model using Fluent NHibernate. If someone can just put me in the right direction that would be appreciated.
Basically I have this class that I would like to map:
public class A : EntityObject
{
//assuming some other attributes have been mapped properly
public virtual Location MyLocation { get; private set; }
}
public class Location : EntityObject
{
public virtual string Name { get; private set; }
}
public Class AMap : ClassMap<A>
{
//???? How to map the Location
}
From database pov, there is no direct relationship from Table "A" to Table "Location". Table "A" has to go through Table "B" and Table "C" using join before having access to the LocationId column which can then me mapped to the Location table.
What's the best way in mapping the Location object in Fluent NHibernate? If there is anything that is unclear, please let me know.
Any help would be appreciated?
Thanks in advance.