i m new to nhibenate and i really find it painful to write the entire mapping files is there a tool or a vs addin that helps you do the mapping ?
thx for your time :)
i m new to nhibenate and i really find it painful to write the entire mapping files is there a tool or a vs addin that helps you do the mapping ?
thx for your time :)
If you have an existing database that you want to map you can use the open source tool MyGeneration to create both mapping files and the domain objects from the database. In this screencast you can see how this can be done.
You can also use CodeSmith, however this is a commercial tool. This screencast shows the use of this tool with NHibernate.
If you write the XML yourself, make sure that you have intellisense in VS. This blog describes how this is done.
If it is just the XML you don't like, check out http://wiki.fluentnhibernate.org where you do the mapping with C# code. Check out this blog post (mine) for an example.
You can also do the mapping with Attributes, but there seems to be not to many examples of this.
You can also check out Caste ActiveRecord, which "is built on top of NHibernate, but its attribute-based mapping free the developer of writing XML for database-to-object mapping, which is needed when using NHibernate directly". Here are some tutorials on this.