Archive For The “AutoMapper” Category

ASP.NET MVC, TDD and AutoMapper

This post is in response to a question on a recent article I wrote about mapping domain entities to presentation models with AutoMapper, an object-object mapper for .NET. Today I will give a brief example of how we can tie it all together in an ASP.NET MVC application using dependency injection and application services. First, […]

Read more »

AutoMapper: writing a custom IValueResolver for Gravatar

I’m a big fan of Jimmy Bogard’s AutoMapper – a handy little tool for fluently mapping your domain model objects to presentation model objects. This week, I added Gravatar support to a small side-project I’m working on. For those that don’t know, Gravatar is a globally recognized avatar with a URL based on the MD5 […]

Read more »

Mocking out AutoMapper with Dependency Injection

I’m a big fan of AutoMapper, an open-source object/object mapper for .NET. One thing I’ve noticed, however, is that all the examples I’ve seen all talk to the static Mapper class. This becomes a real pain when you need to test something that uses AutoMapper, because you can’t swap it out for testing purposes: I […]

Read more »

Domain entities vs presentation model objects, part 2: mapping

This is the second half of a two-part article. Read the first half here: Domain entities vs presentation model objects. In my last post, I wrote about the difference between domain entities and presentation model objects. Remember my two task classes — the transactional domain entity and the UI presentation object? They’re very similar, and […]

Read more »