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

Fluent mapping

As already briefly discussed, fluent mapping is a technique where we use a framework that exposes a fluent API to define the mappings for our domain model. The fluent API makes a mapping very readable as there is no unnecessary code noise involved, such as angle brackets.

Fluent mappings are defined in C# and the framework makes heavy use of expression trees to allow us to define all details in a type-safe way without using magic strings. This makes tasks, such as refactoring entities, a breeze as tools such as Visual Studio or ReSharper can automatically refactor the affected mapping files too.

Expression trees – please explain

When Microsoft introduced LINQ for .NET 3.5, it had to first create the necessary infrastructure. LINQ heavily ...

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