Thursday, 22 July 2010

XML-free …compiled mappings WITHOUT Fluent NHibernate – sample project available

In the earlier posts in the series, we saw how to write conventions that map Id and properties on domain objects automatically. The point of the series is to show that writing your own set of conventions is actually a pretty simple if you are familiar with System.Reflection, and you can have a very fine grained level of control over your NHibernate mappings.

The project contains a simple domain model and a suite of convention that generate NHibernate mappings for identities, properties and many-to-one relationships for the domain model, and should provide a good starting point for your own convention suite. Just run the project and you can see the generated xml.

UPDATE: I've created a new version of the project at https://github.com/mcintyre321/NhCodeFirst which has some fairly cunning mapping support

0 comments:

Post a Comment