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

No mapping; is that possible?

When starting a brand new project without any legacy code or database to carry over, it is strongly recommended not to define the mappings all together. We should let the framework do this work for us automatically, based on meaningful assumptions. These assumptions should be applied to the system in the form of conventions and the conventions should be easily modifiable by us. Is this possible? Yes! We even have two possibilities to doing so. The first one is offered by Fluent NHibernate and the second one by ConfORM (see http://code.google.com/p/codeconform).

Auto-mapping with Fluent NHibernate

To be able to do this, first of all you would want to group the entities you want to map in a namespace, which is distinct ...

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