MBursill wrote:
<class name="User" table="Users">
I think that is what is giving me troubles. I have that mapping file inside my DA layer, perhaps I need to move it to the BLL and NHibernate will make the reference to the middle tier for me?
You can have your mapping files pretty much anywhere. They just need to be loaded by NHibernate when you configure your SessionFactory.
MBursill wrote:
I was hoping to keep everything NHibernate specific (including mapping files) inside the DA layer, but I'll give this a shot.
Here's what I have. I have a BusinessObject assembly. In that assembly I have my hbm.xml files. (So, my POCOs and the POCO.hbm.xml files are in the same assembly)
There is NO reference between my DA assembly and my BO assembly.
But, my DA layer has this code which loads the BO assembly at runtime:
Code:
_nhConfiguration.AddAssembly("MyBOAssembly");
That is how NHibernate gets to "know" about your POCO's, but it isn't a reference like you would create in Visual Studio.