Are there any free tools to help simplify working with an NHibernate project in .NET 3.5? Primarily, I\'m looking for some kind of code and config file generator to automat
The latest version of LLBLGen is able to generate sample Fluent NHibernate Mapping Classes and entities.
ActiveWriter is a plugin to Visual Studio that generates some files for NHibernate, but I haven't had a chance to dig into it yet.
Have a look at: dPulpo, a datalayer generation tool that generates NHibernate mapping files, C# entity classes and your SQL database. There is a Visual Studio plugin and it's currently in beta and free for download.
NHibernate Query Analyzer is a must for constructing queries. It's not for configuration, I know, but a must when trying to get your head around HQL.
Fluent-NHibernate presents an alternative way of writing your mapping, that for example is more refactor friendly than the standard XML approach.
Example:
public CustomerMap : ClassMap<Customer>
{
public CustomerMap()
{
Id(x => x.ID);
Map(x => x.Name);
Map(x => x.Credit);
HasMany<Product>(x => x.Products)
.AsBag();
Component<Address>(x => x.Address, m =>
{
m.Map(x => x.AddressLine1);
m.Map(x => x.AddressLine2);
m.Map(x => x.CityName);
m.Map(x => x.CountryName);
});
}
David Hayden has put together T4 Templates that generate sample Fluent NHibernate Mapping Classes.
http://codebetter.com/blogs/david.hayden/archive/2008/12/14/t4-templates-for-fluent-nhibernate.aspx