NHibernate in a class library? -
i have visual studio 2010 mvc 3 web solution containing number of projects. 1 of these projects site, handles data access.
i using nhibernate access database , have put mapping files, nhibernate.config , nh dlls inside data access project.
i have enough of idea how use nhibernate i've ever used in small, single test projects - never solution multiple projects
i want reference nhibernate.config in site's web.config - can that? if not should do? put the nh dlls in site's bin folder , stick nh config straight dll?
totally lost - appreciated!
i put nhibernate.config in web project , data access layer create session factory this:
private isessionfactory createsessionfactory() { configuration cfg; cfg = new configuration().configure(path.combine(appdomain.currentdomain.basedirectory, "nhibernate.config")); return (cfg.buildsessionfactory()); }
always searching nhibernate.config in base directory, can reference dal in other projects.
Comments
Post a Comment