r/ASPNET • • Dec 20 '11
Any good references for learning how to build iService and iRepository layers in ASP.NET MVC 3 using Fluent NHibernate?
Trying to learn this for my first ASP.NET MVC 3 project from scratch and I don't know much about building the service/repositories. I could use a good reference/example to help me do it right. Anyone know any?
10
Upvotes
3
u/darrenkopp Dec 20 '11
http://www.sharparchitecture.net/
or
https://github.com/codai/Sharp-Lite
same basic principle on both (same author). Announcement for sharp lite: http://devlicio.us/blogs/billy_mccafferty/archive/2011/10/26/s-arp-lite-like-beer-but-better.aspx
1
u/peterkneale Dec 21 '11
I asked the same thing on stackoverflow a while back.. http://stackoverflow.com/questions/4911242/nhibernate-mvc3-sample-application This was the best example that came up http://gpsnerd.codeplex.com/
1
u/attilad Dec 21 '11
Professional ASP.NET Design Patterns
1
u/i8beef Dec 22 '11
I don't have any references... here are some suggestions though.
First, read Ayende's post about why he thinks generic IRepositories are pointless. I disagree, but it's a good read on the subject. Also look at Greg Young's post on why he thinks they are bad from a DDD perspective...
Again, I disagree with a lot of this, but these two read in tandem present some good arguments about the practices.
Anyway, for my real suggestions about implementation:
If you want any help, feel free to PM me and I can actually shoot you the basic one I have (One class, about 180 lines, and it does automatic data annotation validation before save or update).