Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use NHibernate with asp.net 3.5

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.

like image 884
Chandra Prakash Avatar asked Dec 05 '22 01:12

Chandra Prakash


1 Answers

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/

like image 186
Gage Avatar answered Dec 09 '22 16:12

Gage