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

Mapping with ConfORM

The ConfORM project brings convention-based mappings to NHibernate. In this recipe, I'll show you how to map your model using ConfORM conventions.

Getting ready

  1. Check out the ConfORM source code from Google Code at http://code.google.com/p/codeconform/source/checkout.
  2. Build the ConfORM project.
  3. Complete the previous Eg.Core model and mapping recipes.

How to do it...

  1. Create a new console project named Eg.ConfORMMappings.
  2. Add references to the Eg.Core model project, ConfORM.dll and ConfORM.Shop.dll.
  3. In Eg.Core.Entity, make the Version property public.
  4. In Program.cs, add the following using statements to the beginning of the file:
    using System; using System.IO; using System.Linq; using System.Xml; using System.Xml.Serialization; using ...

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