Exposing the XML Mappings in Fluent NHibernate

Jul 6, 2009

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 |

Share with others

No Responses so far | Have Your Say!

Leave a Feedback

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>