Category Archives: NHibernate

Migrating from NHibernate to Entity Framework

I’ve been a supporter and user of NHibernate for nearly 10 years. While not part of the original NHibernate Mafia, I’ve long enjoyed NHibernate’s ability to rich, behavioral domain models. I wasn’t happy with the initial designs of Entity Framework, … Continue reading 

| 31 Comments

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 

| 8 Comments

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 

| 11 Comments

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 

| 8 Comments

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 

Also posted in AngularJS, introduction | 10 Comments

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 

| Comments Off

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 

| Comments Off

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 

Also posted in book, Fluent NHibernate, misc | 26 Comments

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 

Also posted in How To | 3 Comments

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 

Also posted in book, introduction, tutorial | 16 Comments