I'm new to NHibernate, so be gentle :-)
We have an existing business layer containing C# entities.
I am about to write a data access layer, using NHibernate to bind the relational database (SQL 2005) to the business layer.
I can get this to work in a simple test app, but things go bad when I try to seperate the BL and DAL into seperate assemblies. In effect, the persist classes (the entities in my BL) live in one assembly and the XML mappings (in the form of an hbm.xml file) live in another.
When I attempt to retrieve data from the DB with code similar to
session.Load(typeof(ApplicationEntity), id);
the NHibernate runtime fails to find the persister because it lives in another assembly (the BL).
Has anyone got any advice? Is what I'm trying to do fundamentally wrong?
Cheers.
FlyTVR
|