Category Archives: NHibernate

Using AutoMapper to perform LINQ aggregations

In the last post I showed how AutoMapper and its LINQ projection can prevent SELECT N+1 problems and other lazy loading problems. That was pretty cool, but wait, there’s more! What about complex aggregation? LINQ can support all sorts of … Continue reading 


Using AutoMapper to prevent SELECT N+1 problems

Back in my post about efficient querying with AutoMapper, LINQ and future queries, one piece I glossed over was how View Models and LINQ projection can prevent SELECT N+1 problems. In the original controller action, I had code like this: … Continue reading 


Avoid many-to-many mappings in ORMs

Going through and reviewing the Contoso University codebase, really to get caught up on EF 6 features, I found a relationship between two tables that resulted in a many-to-many mapping. We have these tables: A Course can have many Instructors, … Continue reading 


NServiceBus and concurrency

A while back, Andreas posted on NServiceBus sagas and concurrency. In that post, he described both what to consider and how to change the concurrency model of NServiceBus and how it relates to sagas. One thing that comes as a … Continue reading 


ORM techniques for legacy databases

One of the reasons folks typically go with a hand-rolled ORM (i.e., using ADO.NET by hand) is the assumption that ORMs don’t work well with legacy databases or databases designed in isolation from any sort of object model used to … Continue reading 


Persisting enumeration classes with NHibernate

As part of my “Crafting Wicked Domain Models” talk, I walk through the concept of enumeration classes, yanked from Java and on Jon Skeet’s list of biggest C# mistakes (or missing features). In my talk, I leave out how to … Continue reading 


Win Free Copies of NHibernate 3 Beginner’s Guide

Readers would be pleased to know that I have teamed up with Packt Publishing and we are organizing a Giveaway especially for you and three lucky winners stand a chance to win a copy of Keep reading to find out … Continue reading 


How to map a domain model with NHibernate?

Today a friend of mine ask me the following (I am para-phrasing): “I have a question regarding NHibernate and mapping. In an application we want to access the database through NHibernate from inside a WCF service, thus lazy loading is … Continue reading 


NHibernate 3 Beginners Guide published

I am very pleased to announce that my book NHibernate 3 Beginners Guide has finally been published. It is a wonderful feeling to finally have a book in my hands that cost me a couple of months of intense work. … Continue reading 


NHibernate 3 Beginners Guide

I am heading towards another mile stone in my life. Later this year my first book will be published. I have always wanted to write a book but never had a topic that is at the same time interesting for … Continue reading