4

I found a fantastic template for NHibernate code generation using MyGeneration here,

http://vucetica.blogspot.com/2009/01/nhibernate-template-for-mygeneration.html

This creates XML mapping files with the extension hbm.xml.

I was wonder if anybody knows of templates which support fluent NHibernate which defines the mapping using C# files.

Thanks

peter
  • 13,009
  • 22
  • 82
  • 142
  • I am not aware of any solution for this that exists and I've looked. – Michael Maddox Nov 08 '09 at 10:17
  • Maybe one day we will make our own template, I will publish it in that case. Too early to say which way we will go. – peter Nov 08 '09 at 20:59
  • Any other NHibernate code generation tools that anybody would suggest? I have tried some of them, and most of them are not that great. We are using MSSQL 2008. – peter Nov 08 '09 at 21:00
  • I'm also wondering if there is a fluent template... would be awesome if there was. – Peter Walke Mar 21 '11 at 18:50

1 Answers1

1

When you are using Fluent NHiberate you needn't hbm files, you can generate them based on your domain model and conventions

Sly
  • 15,046
  • 12
  • 60
  • 89
  • 1
    Aren't you assuming that the domain model / classes already exist? What if the OP has a database but no classes defined and wants to auto-generate the classes? – Michael Maddox Nov 08 '09 at 10:13
  • Using auto mapping is an option, but it might not be flexible enough. Hard to say at this stage. I will keep it in mind though - it is good to know about. Thanks. – peter Nov 08 '09 at 20:57