O'Reilly logo

NHibernate 3.0 Cookbook by Jason Dentler

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

Configuring NHibernate with Fluent NHibernate

In addition to fluent mappings and auto-mappings, the Fluent NHibernate project also brings its own code configuration syntax to NHibernate configuration. In this recipe, I'll show you how to configure NHibernate with the Fluent NHibernate syntax.

Getting ready

  1. Complete the Eg.FluentMappings model and mapping from the Creating Mappings Fluently recipe in Chapter 1.
  2. Add a console application project to your solution named ConfigByFNH.
  3. Set it as the Startup project for your solution.
  4. In the ConfigByFNH project, add references to NHibernate.dll, NHibernate.ByteCode.Castle.dll, and FluentNHibernate.dll in the Lib folder.
  5. In ConfigByFNH, add a reference to the Eg.FluentMappings project.

How to do it…

  1. Add an App.config ...

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