Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>has this been solved? if not could you inlcude your setup?</p> <p>for example here is my example one</p> <pre><code>public static ISessionFactory GetSessionFactory() { //Old way, uses HBM files only //return (new Configuration()).Configure().BuildSessionFactory(); //requies the XMl file. //get database settings. Configuration cfg = new Configuration();//.Configure(); ft = Fluently.Configure(cfg); //DbConnection by fluent ft.Database ( MsSqlConfiguration .MsSql2005 .ConnectionString(c =&gt; c .Server(".\\SqlExpress") .Database("NhibTest") .TrustedConnection() ) .ShowSql() .UseReflectionOptimizer() ); //set up the proxy engine //cfg.Properties.Add("proxyfactory.factory_class", "NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle"); //get mapping files. ft.Mappings(m =&gt; { //set up the mapping locations m.FluentMappings.AddFromAssemblyOf&lt;PersonMap&gt;();//.ExportTo("C:\\mappingfiles"); //m.Apply(cfg); }); //return the SessionFactory return ft.BuildSessionFactory(); } </code></pre> <p>the project structure is as follows</p> <ul> <li>project.Data &lt;- mapping files, and Dao's (also hibernate session manager, containing the above code)</li> <li>project.Core &lt;- POCO's</li> <li>project.UI</li> </ul> <p>also have look <a href="https://stackoverflow.com/questions/969408/nhibernate-no-persister-for-nhibernate-criterion-sqlfunctionprojection">here</a> incase you have a mixture of Fluent NHibernate and NHibernate configuration</p> <p>Finally have a look at S#arp Architectures way, as i think it includes this mixture</p> <p><a href="http://code.google.com/p/sharp-architecture/source/browse/trunk/src/SharpArch/SharpArch.Data/NHibernate/NHibernateSession.cs" rel="nofollow noreferrer">NhibernateSession</a> &lt;- function : <code>private static ISessionFactory CreateSessionFactoryFor</code></p> <p>Hope this helps</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload