views:

84

answers:

4

Hi,

I want to use NHibernate with Asp.net 3.5 but i don't know how to use it.I search on Google but couldn't find the complete explanation about why to use NHibernate,Advantages of using it and integration with Asp.net projects.Please Help me.

+2  A: 

The best place to look is at NHibernate Forge. There's Blogs, wikis and groups that will help you out.

As for advantages of using it that is something you need to workout for yourself. Is it more advantageous than LinqToSql or Entity Framework? It depends on the project size and what you are actually looking for.

heads5150
+3  A: 

I'm nearing completion of my first project with it, and I've had mixed results. For basic data persistence, and assuming you already knew how to use it, it's much faster to build an application with it. You don't really have to worry about building stored procs and differentiating between new objects and updated objects.

On the other hand, until you're quite comfortable with it, it can take a long time to do something that would have been simple before. I've had a couple of problems, and it has been difficult and time consuming finding solutions to them.

To be fair, I've only written small applications with it and it has made the development process more difficult than I would consider required. The pain of using it is fairly similar from one app to the next, the benefits scale...

Kendrick
+5  A: 

I would suggest checking out Castle and NHibernate. I recently started using it and was blown away with what it can do. Castle manages all your sessions for you. Also it is easy to use LINQ with it.

Check out
http://davidhayden.com/blog/dave/archive/2008/04/28/NHibernateCastleActiveRecordTutorialUninitiated.aspx

Another great tool to use (Should work with ASP.Net) is the Nhibernate Profiler http://nhprof.com/ It shows you what queries are being generated and the time its taking to run.

Also if you already have your database created you can download this tool http://www.agilityfororms.com/Home/Products/AfoCastleActiveRecordModelCodeGenerator/ It will create your models based on your database. Its works great for the most part. Although you have to register to download the free version still worth checking out.

Fluent NHibernate is supposed to be good as well although I have no experience with it. Might be worth checking out. http://fluentnhibernate.org/

Gage