T4 Templates for Fluent NHibernate

I put together T4 Templates that generate sample Fluent NHibernate Mapping Classes based on metadata in a LINQ To SQL DBML File:



These aren’t production quality T4 Templates, but more of a proof of concept that I put together rather quickly to jumpstart the conversion to NHibernate from LINQ To SQL. I had to manually make some changes after running the templates to support many-to-many relationships that are not supported by LINQ To SQL, tweak lengths of certain database columns, etc. There are probably a number of limitations I am not aware of, but they worked well given the simple nature of the relational database model I was dealing with. Depending on your situation your mileage may vary :)


 



 



 


You can learn more about the T4 Templates here.


 


Recent Posts:



 

This entry was posted in Uncategorized. Bookmark the permalink. Follow any comments here with the RSS feed for this post.

One Response to T4 Templates for Fluent NHibernate

  1. Very cool, nice work David.

    I (being on the Fluent NHibernate team) am really flattered by efforts by people like yourself in making fluent nhib even better. Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>