Author Archives: Jimmy Bogard

About Jimmy Bogard

I'm a technical architect with Headspring in Austin, TX. I focus on DDD, distributed systems, and any other acronym-centric design/architecture/methodology. I created AutoMapper and am a co-author of the ASP.NET MVC in Action books.

Missing NHibernate features in Entity Framework

Recently I blogged about migrating to EF from NHibernate and how easy it is to create fully encapsulated models mapped to EF. In this particular project, migrating was relatively painless, as it was a fairly new schema and quite amenable … Continue reading 

Posted in Entity Framework, NHibernate | 20 Comments

Domain modeling with Entity Framework scorecard

A long, long time ago I had a series on strengthening your domain, highlighting how simple refactoring tools and code smells can help guide your models to push behavior down into your core domain model/business objects/whatever. All the techniques highlighted … Continue reading 

Posted in Domain-Driven Design, Entity Framework, NHibernate | 23 Comments

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 

Posted in Entity Framework, NHibernate | 50 Comments

AutoMapper 3.2.0 released

Full release notes on the GitHub site Big features/improvements: LINQ queryable extensions greatly improved ICollection supported MaxDepth supported Custom MapFrom expressions supported (including aggregations) Inherited mapping configuration applied Windows Universal Apps supported Fixed NuGet package to not have DLL in … Continue reading 

Posted in AutoMapper | 17 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 

Posted in AutoMapper, Entity Framework, NHibernate | 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 

Posted in AutoMapper, Entity Framework, NHibernate | 13 Comments

Successful IoC container usage

Every now and again I here the meme of IoC containers being bad, they lead to bad developer practices, they’re too complicated and on and on. IoC containers – like any sharp tool – can be easily abused. Dependency injection, … Continue reading 

Posted in Dependency Injection, OO | 25 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 

Posted in Entity Framework, NHibernate | 13 Comments

Efficient querying with LINQ, AutoMapper and Future queries

Even after all these years, I’m still a big fan of ORMs. One common complaint over the years is people using ORMs use the tool identically for both reads and writes. With writes, I want tracked entities, managed relationships, cascades … Continue reading 

Posted in AutoMapper, Entity Framework, LINQ | 30 Comments

Reducing NServiceBus Saga load

When presented with concurrency issues with NServiceBus sagas, you’re generally presented with two options: Relax the transaction isolation level Reduce worker thread count, forcing serialized processing of messages Both of these are generally not a great solution, as neither actually … Continue reading 

Posted in NServiceBus | 10 Comments