O'Reilly logo

NHibernate 3 Beginner's Guide by Gabriel N. Schenker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – Creating a session factory

We now want to write the code necessary to create a session factory for our product inventory application.

  1. Add a reference NHibernate.ByteCode.Castle.dll to the project. This file can be found in the lib folder. NHibernate needs this assembly to create proxies.
  2. Add a using NHibernate statement to the preceding code of MainWindow (the MainWindow.xaml.cs file).
  3. Add a CreateSessionFactory method, as described above, to the preceding code.
  4. Extend the grid of MainWindow with another row with a height set to Auto.
  5. Add another button to the MainWindow and name it btnCreateSessionFactory and define its content as Create Session Factory. Set the Grid.Row to 1. Furthermore, define a click event handler for this new ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required