It’s time for another episode of the Mvc Screencast! I hope you’ve been able to check out the first eight episodes to date. If so, feel free to leave a comment here and let me know what you think. Don’t be shy about tweeting or sharing this series, either. I’d appreciate it if you did!


In this episode, I talk about Big M Models, Domain Models, View Models, object-to-object mapping, and finally AutoMapper, an OSS tool created by Jimmy Bogard with the goal of making object-to-object mapping simple, conventional and configurable. I’ll also demonstrate how you can quickly integrate AutoMapper into an MVC application, and use it to map from Domain objects to ViewModel objects.

If you want to learn more about AutoMapper, check out You can also download or fork the source on GitHub at

Click on the embedded video below (~17 minutes), click here to view it on Channel 9, or if you want to view the video on your shiny, new WIndows Phone 7, click here to download a mobile-ready version.

I’d love to hear your thoughts, questions or suggestions below. Thanks for watching and sharing!

Tagged with:
  • Ignacio Fuentes

    I know it’s been a while since you posted this but Im still somewhat confused about Automapper. It really does work pretty well to generate a viewmodel from a domain model but doesnt really work well for the opposite (i have had many problems with it at least).. Jimmy Bogard actually discourages this practice …. although I dont really understand his approach on solving it… what do you feel on this issue?

  • Ignacio Fuentes

    Reading more and more into it, people very frequently will have problems that dont seem to have a clean solution…. 

  • Brandon Satrom

    I can understand where Jimmy is coming from on this issue. In a perfect world, it’s probably best to use a Command pattern varation and/or CQ(R)S in your architectures, which obviates the need for two-way mappings. However, I don’t think Command/CQRS is ALWAYS appropriate, especially with simplier applications. One could argue that perhaps AutoMapper isn’t appropriate in those cases, but I’m not sure I agree since there are many who advocate ALWAYS using DTOs in MVC applications, regardless of size.

    So where I stand is this: If complexity warrants, use Command with AutoMapper. Otherwise, use AutoMapper with one of the two-way workarounds or handle the mappings by hand.

    Hope that helps!

Switch to our mobile site