Time for action – Configuring NHibernate in code

In this exercise, we are going to implement a simple application using NHibernate which fully configures the ORM framework in code.

  1. Open SQL Server Management Studio (SSMS) and create a new database called CodeConfigurationSample.
  2. Open Visual Studio and create a new project. Select Console Application as the project template. Call the project CodeConfigurationSample.
  3. Add a reference to the two assemblies NHibernate.dll and NHibernate.ByteCode.Castle.dll to the project.
  4. In the Solution Explorer, right-click on the solution and select Add | New Folder and name the folder Schema.
  5. Right-click on the Schema solution folder and select Add | Existing Item. Add the two files, nhibernate-configuration.xsd and ...

Get NHibernate 3 Beginner's Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.