tags:

views:

1568

answers:

3

Hi I am planning to use NHibernate for my next project with mapping through FluentNHibernate. I have a database already, so I have to generate C# classes for entities mapped to database tables.

What tool would you recommend (if there is any?) for automatic C# class generation for NH from MS SQL database?

Thanks for sharing.

+2  A: 

NConstruct Lite will generate the classes and the hbm mapping files for free even though it does not support fluent NHibernate, nor does it make use of some of the new C# 3.0 features.

Manu
+1  A: 

Check Castle Project ActiveRecord.

CMS
+2  A: 

Don't.

The whole point of object-relational mapping is to... well... map.

If you generate the classes from the database you may as well be using typed datasets.

Think about what you would want your classes to look like in the object world and then use NHibernate to map that to your database schema.

Alun Harford