Log in / create account

Fluent NHibernate wiki

Talk:Getting started

From Fluent NHibernate

Hi Folks, I like the tutorial, but I'm having / had some issues.

For all your sample code, PLEASE always include the using statements.

Also, I'm using VS 2008 Pro. Out of the box, it likes to create new classes like

using System; using System.Collections.Generic; using System.Linq; using System.Text;

namespace nHibernateReference.Entities {

   class Employee
   {
       public virtual int Id { get; private set; }
       public virtual string FirstName { get; set; }
       public virtual string LastName { get; set; }
       public virtual Store Store { get; set; }
   }

}

Which will not compile until you take out the namespace.

For clarity, you might consider putting the entire code chunk in the pages verbatim.

I love nHibernate and have used it on several projects, but this lack of attention to the small details ( maybe because I'm just not experienced enough with c# ) is a truly frustrating experience when I'm trying to sell nHibernate to a new Employer.

Please do keep up the excellent work, and also please do go through your own tutorials doing exactly what they show. Then go back and make things clearer where necessary. It will help new folks immensely.

ProxyFactory configuration missing

The database configuration inside CreateSessionFactory is missing the ProxyFactoryFactory invocation. Since issue 154 is a wontfix, a line

.ProxyFactoryFactory("NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle") will be need to be added to database configuration call. Mine looks like this:

return Fluently.Configure().Database(SQLiteConfiguration.Standard.UsingFile("firstProject.db").ProxyFactoryFactory("NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle"))

Page Discussion View source History