O'Reilly logo

ASP.NET MVC 2 in Action by Matthew Hinze, Eric Hexter, Jimmy Bogard, Ben Scheirman, Jeffrey Palermo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 18. Mapping with AutoMapper

This chapter covers

  • Understanding AutoMapper
  • Configuring AutoMapper
  • Testing conventions
  • Applying formatters to eliminate duplicative code
  • Reducing markup to presentation only
  • Ridding views of complexity

The open source AutoMapper library is a convention-based object-to-object mapper. It takes source objects of one type and maps them to destination objects of another type. This is useful in many contexts, but we’ll use it to map from a domain model to the model objects our views display—the presentation model.

We call it convention based because it doesn’t depend on configuring each type’s member’s mapping, but instead relies on naming patterns and sensible defaults. You can check out the code and read ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required