Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nHibernate + Mvc3 Sample Application

I'm looking for a decent codebase that demonstrates how to use nHibernate as the persistance layer in an asp.net mvc3 project.

The two key pieces of understanding that I am looking to develop are

  1. How to deal with ISession and ISessionFactory.
  2. How to implement the repository pattern without leaking any details of its nHibernate implemenation.

I'm aware of Sharp Architecture and reading through that now - Its interesting but I'm more keen on finding a straight-forward web app to pick apart than another framework to learn.

Thanks in advance.

like image 715
Peter Kneale Avatar asked Feb 06 '11 03:02

Peter Kneale


2 Answers

I put together a project that offers an example of how to do this using nhibernate and asp.net mvc 2. The repository and nhibernate implementations will be almost the same. Probably the biggest change will be the ioc / dependency injection piece. Take a look. It should provide a solid starting point. Here is the URL.

http://gpsnerd.codeplex.com

Let me know if you have questions.

Bob

like image 195
rcravens Avatar answered Nov 20 '22 21:11

rcravens


Take a look at https://bitbucket.org/FunnelWeb/dev

FunnelWeb is a blog engine based on ASP.NET MVC and NHibernate. It is opensource and used by many bloggers/develoeprs

like image 24
ITmeze Avatar answered Nov 20 '22 20:11

ITmeze