Published on

AutoMapper

Authors
  • avatar
    Name
    Mike Barram
    Twitter

From http://stackoverflow.com/tags/automapper/info

AutoMapper uses a fluent configuration API to define an object-object mapping strategy. AutoMapper uses a convention-based matching algorithm to match up source to destination values. Currently, AutoMapper is geared towards model projection scenarios to flatten complex object models to DTOs and other simple objects, whose design is better suited for serialization, communication, messaging, or simply an anti-corruption layer between the domain and application layer.

Slightly slow but useful video to show how AutoMapper is useful

http://dnrtv.com/player/player.aspx?ShowNum=0155

Note that the video is for v1 from 2009

Demonstrates how you can easily create an object that is a flattened view of a number of base objects – particularly useful for presentation of data or transferring data to a client as JSON in simple flat structure.

@26 minutes – a nice way to conditionally format text e.g. showing singular/plural or converting dates to strings.