automapping Entities in nhibernate -


I'm having a slight problem mapping all the entities contained in the namespace "nhibernateTest.Domain". It basically includes all map classes such as studentmap, departmentmap etc. Now what we used to do in the case of general nineteen:

  Private Eationfinder _sessionFactory; Private configuration _configuration; [TestFixtureSetUp] Public Zero TestFixtureSetUp () {_configuration = New Configuration (). Configure (). AddAssembly ("nHibernateTest"); _sessionFactory = _configuration.BuildSessionFactory (); }   

What to do now is to see all "* .hbm.xml" files in my namespace and automatically map them ...

Can anyone tell me how to do this for fluent nHibernate? So that it looks for all map squares and automatically maps them so that I have to make sessions different for different map sections?

You must specify your mapping when configuring Fluent NBibernate in your application. This is usually done by

 . Briefly. Database (/ * Your Database Settings * /) ExposeConfiguration (/ * Configuration * / / Optional Optional //) .BuildSessionFactory ();   

The above code is by this excellent how to configure Fluent

Comments