Another NHibernate Repository
I’ve been having a lot of fun with NHibernate recently and, during my spare time, have a few pet projects that I like to work on to improve my skillset (especially because it looks like my company is going to give an ORM a test run in the not too distant future). Everyone has their opinion on whether or not a Repository with an ORM is a good thing or a bad thing, and I’m not going to rehash any such arguments, except to say the following: I needed to stop implementing the same old LoadSomethingById, UpdateSomething, SaveSomething, etc. methods for every single data type in my service layer. I found myself re-inventing the wheel, albeit with different naming conventions, over and over again While NHibernate does provide a layer of abstraction in and of itself, I was reluctant to couple a particular ORM to my solution (i.e. call _session.Load<SomeType>(id) directly from my controller/codebehind/whatever) So, as a learning exercise (like the world needed another one…) I ...