Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

T4 template for NHibernate? - not Fluent NHibernate

Wondering if anyone knows of a set of T4 templates for generating C# POCO classes and also mapping XML files for NHibernate from a set of tables in a database. I saw that David Hayden has created T4 for generating FluentNH code based upon a DBML model, but I'm not quite ready to use FluentNH yet as there isn't even an official release yet (although I love the idea).

Anyone know of any T4 templates for using plain NHibernate?

like image 366
NathanD Avatar asked Feb 03 '09 17:02

NathanD


4 Answers

May not be the answer you are looking for, but I spent a good amount of time a couple months ago looking everywhere for the same thing. I couldn't find any, though.

Not sure if you're set on using T4 for any particular reason, but I ended up using CodeSmith for code generation because there are several templates already available. There are a handful for MyGeneration, but CodeSmith was much farther along.

NOTE: If you do find some, though, you should post it here as I, and probably other people, would be rabidly interested in finding some well done T4 templates for nHibernate.

like image 169
joshua.ewer Avatar answered Nov 02 '22 09:11

joshua.ewer


LLBLGen's upcoming release (V3), currently in beta, will have templates for generating NHibernate POCO classes and mappings, as well as templates for EF1/4 and its own framework.

like image 26
Matt Avatar answered Nov 02 '22 08:11

Matt


I'm trying to make one. Check it out: https://code.google.com/p/t4nh/

I use this template set in three of my projects, and it works well. Not published formerly since I still don't know if people can apply it well. Hope I can make my template set better with the community

like image 27
Genius Avatar answered Nov 02 '22 08:11

Genius


Try Entity Developer from Devart. I need a little tweaked version for dynamic fields, but what I have seen so far looks good. I need to edit the T4 templates and would prefere to do it in VS, not in Entity Developer, which is how I found this thread...

like image 1
paul Avatar answered Nov 02 '22 10:11

paul