This past weekend as I was working with Fluent NHibernate, I received an error from NHibernate saying the mapping was incorrect. Since Fluent NHibernate creates the xml mappings, there wasn’t an easy way for me to see what was wrong in the xml mapping. After a little research I figured out how to get Fluent NHibernate to write the xml mappings to a directory. Check out the code below

var mappings = AutoPersistenceModel.MapEntitiesFromAssemblyOf();
mappings.CompileMappings();
mappings.WriteMappingsTo("SomeDirectory");
 | Posted by admin | Categories: Uncategorized |