# 111 - Introduction to AutoMapper


5/19/2009
Level: Beginner
Tags: Dot Net
Comments: (14)
Author:
Eric Polerecky


In this episode we will take a look at how we can simplify our entity mapping by using AutoMapper.

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.
Click here to Watch this Episode

Download (27.45) (12:33) (1280x1024)

Links/Resources:


Comments: (14)

joe said....

For very basic mappings why do they need to be registered?  For example is there a default converntion that would let en Entity.Supplier be mapped to a Poco.Supplier?


5/19/2009 8:35:43 AM

Jimmy Bogard said....

@joe

Because you lose the Mapper.AssertConfigurationIsValid advantage.  Testing mappings is still important, as renaming a field on the source would cause a mapping to break.  For us, it's still a 2 line unit test to validate our configuration.


5/19/2009 8:40:54 AM

LUSIK said....

Testing testing


5/19/2009 3:21:37 PM

Sean Feldman said....

Thank you for the podcast.

One comment - half of the podcast went for explanations about Entities Framework and Entity / POCO / DTO concepts. That was a time that should probably invested into showing more of the actual subject, AutoMapper.


5/19/2009 8:14:38 PM

DaRage said....

Thank you but I found it hard to follow. There was a lot of half spoken words, yada yada and blah blah said. I wished to hear a clearer explaination of the subject. 


5/20/2009 7:06:43 AM

Eric Polerecky said....

@Sean -

Automapper is so simple and works so well its a very simple demo. Its important to understand why/when you would use automapper.

@DaRage -

Sorry about that; I recorded it around 4am and I was just finising up a long night of coding...


5/20/2009 1:52:24 PM

Dave said....

Nice demo, loving the tool, it has already made my life a little easier. :)


6/15/2009 11:24:06 AM

play with hard hands in blackjack said....

I completely agree with the above comment, the internet is with a doubt growing into the most important medium of communication across the globe and its due to sites like this that ideas are spreading so quickly.


1/13/2010 3:22:04 AM

health insurance said....

Wow! i agree! i’ve been searching for so long for a site where i could find everything that i want, and i’ve just found it!! really, i’ve visited your blog, and it’s amazing, i will keep visiting


1/17/2010 8:33:12 AM

Facts Of Astrology said....
I would suggest using dependency injection to pass a class that provides the means for retrieving the current user to make this audit implementation more usable from different environments.

1/18/2010 5:28:05 AM

Andriy Buday said....

Looking forward for new episodes on advanced AutoMapper features!


1/20/2010 2:09:19 PM

Download free new movies said....

Testing mappings is still important, as renaming a field on the source would cause a mapping to break.  For us, it's still a 2 line unit test..

 

 

<a href="http://newmoviez1.blogspot.com/">Download free new movies</a>


1/22/2010 10:05:08 AM

TweeZz said....

Hi..

Could you please add an "AutoMapper" tag to this episode? It took me _a while_ to find this one..

Thx..


2/2/2010 10:24:30 PM

joe said....

Derek -- this needs the AutoMapper adding, if you could.  Had to do some poking around to find it (didnt know it existed until 2 mins into the 2nd one where you mention it).


2/5/2010 2:53:42 PM


Name: *
Email (not displayed): *
Url:
Comments: *



So, you Human...?



Submit this story to DotNetKicks
Shout it