# 111 - Introduction to AutoMapper


5/19/2009
Level: Beginner
Tags: Dot Net AutoMapper
Comments: (34)
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 MB) (12:33) (1280x1024)

Links/Resources:


Comments: (34)

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

Dimecasts said....

@Tweezz,

I have added the tag, thanks.


2/10/2010 3:09:06 AM

web development said....

Automap is a map-based autoloader for PHP. As such, it is composed of two parts :

  • A builder software scans some PHP script files and extracts their symbols to a map file. After every script files have been analyzed, the map file contains a lookup table, with each symbol associated to the file it is defined in. This build process is done only once, or when PHP scripts are modified.

3/8/2010 9:46:54 AM

10 meilleurs casinos en ligne pour jouer said....

Looks great!  One suggestion I'd have - we put all of our CreateMap code into one place, and that is executed once in our Global.asax Application_Start event.  Our unit test is then two lines - MapperConfiguration.Configure, then Mapper.AssertConfigurationIsValid.


3/10/2010 3:39:13 AM

10 meilleurs casinos en ligne pour jouer said....

MVC does not specifically mention the data access layer because it is understood to be underneath or encapsulated by the model. Models are not data access objects although in very simple apps, with little domain logic, there is no real distinction to be made.


3/10/2010 3:42:38 AM

replica rolex said....

He might not go this week, but he's further proof sea dweller that being sea dweller adorable can get you into the semifinals but rolex submariner not much rolex submariner further. Urban is the weakest male link, so he might as well blast submariner off with a submariner submariner blaze of glory with something rolex yachtmaster ridiculous like rolex yachtmaster And I Am Telling You I'm Not yachtmaster Going.


3/12/2010 5:02:46 PM

rolex -submariner said....

With yachtmaster rolex yacht master Jermaine Sellers rolex yacht master gone, dancer Hall remains as the loose cannon in the yacht master bunch. His yacht master confidence hasn't yet meshed with a breakout performance, and replica watches though his replica watches sedate take on Tina Turner's What's Love Got to Do With replica watch It was replica watch interesting, Hall has been the fake watches judges' punching fake watches bag to date.


3/12/2010 5:04:10 PM

rolex yacht master said....

Unless he kills it, say with a seductive Usher throw-down, Hall could be rolex the next to rolex go. Speaking of cute, James is still trying to shake off the whole rolex watch cougar-bait rolex watch thing, but his limp rendition of the too-frequent Idol cover I Don't Want to Be didn't rolex watches exactly show rolex watches off his rock chops. Regardless, assuming he doesn't completely tank, Casey replica rolex will likely make the top 12. He should, however, soar by proving replica rolex his grit this week with something edgier. How about an unplugged rolex replica Kid Rock tune? He's the rolex replica token rocker, which is a good place to be this year, because he's got virtually no competition.


3/12/2010 5:05:41 PM

armani watches said....

Dewyze is on a hot streak, and he's got Simon tissot on his tissot side, so he should play it safe this armani watch week to ensure armani watch a top 12 berth. He's done well playing his acoustic armani watches guitar, so armani watches maybe a Kings of Leon song would work for him. What armani happened armani to you, man? Garcia seemed a shoo-in for audemars piguet watch the top audemars piguet watch three.


3/12/2010 6:34:43 PM

lv watches said....


But he's gotten steadily diminishing returns thanks audemars piguet watches to sleepy audemars piguet watches song choices, like James Morrison's You Give Me Something, which audemars piguet find him audemars piguet fading into the pack. He needs another Straight Up, pronto! Now's lv watch the best lv watch time to wow the judges again with a clever arrangement lv watches of a classic lv watches — perhaps a folky version of Jane's Addiction's Been lv Caught lv Stealing?


3/12/2010 6:40:20 PM

parmigiani watches said....

He's not blowing anyone away, but movado watch slow-and-steady movado watch Lynche is getting it done every week. He's likeable, solid and very comfortable onstage. Big movado watches Mike is almost movado watches certainly going to advance, so a bit more of what the movado judges already movado like, perhaps a touch of Maxwell on parmigiani watch acoustic guitar, could parmigiani watch ensure his spot. Either Lambert is pulling a rope-a-dope and is planning to emerge parmigiani watches as a camera-ready parmigiani watches superstar from his mullet-duckling persona, or we're reading too much into his phoenix-like rise from the ashes of two twitchy weeks ago


3/12/2010 6:45:54 PM

corsets bustiers said....

<a href="http://www.yo2underwear.com/corsets-bustiers-c-1.html">corsets bustiers</a> are sexy and cute,just only low price,<a href="http://www.yo2underwear.com">sexy lingerie</a> are really nice.


3/13/2010 10:41:52 PM

replica armani said....

Hurley waking up in the field of flowers reminded me of replica alain silberstein watch the poppy replica alain silberstein watch sequence in The Wizard of Oz. Jack wanting to get moving replica alain silberstein watches toward whatever replica alain silberstein watches destiny awaited him while Hurley wanting to eat replica alain silberstein first—reminders replica alain silberstein that Hurley is gripped by hunger when he’s anxious and Jack armani replica defers food armani replica until his deeper yearnings are sated. They then fought replica armani watch over the replica armani watch right path back to The Temple.


3/14/2010 6:27:42 PM

replica baume mercier said....

Hurley was either going to take the long way replica armani watches or the replica armani watches wrong way, while Jack wanted to go directly back the replica armani way they replica armani came. It was hard to hear the line and not think Lost was audemars piguet replica saying audemars piguet replica something about its two-track, parallel world replica audemars piguet watch structure. Then replica audemars piguet watc Richard showed up and offered a third path. Jack followed. When replica audemars piguet watches Hurley asked replica audemars piguet watches if Richard could be trusted.


3/14/2010 6:29:09 PM

replica alain silberstein said....

Jack said, At least he’s not stallin’. It was another wink at replica audemars piguet the audience replica audemars piguet in an episode full of them. Combined with the line about Napoleon’s Elba being baume mercier replica the place baume mercier replica where everything became clear, I wondered if Lost was addressing replica baume mercier watch anyone griping replica baume mercier watch about the pace of answers and saying, Don’t worry. Trust us. Okay? Ironically, replica baume mercier watches then replica baume mercier watches. He seemed to strongly replica baume mercier imply that replica baume mercier yes indeedy.


3/14/2010 6:30:32 PM

box watches said....

Richard’s replica baume mercier watches path ended parmigiani with… a parmigiani lie. He took them to the Black Rock, which was not where box watch he said was box watch taking them, although it was where we’ve been wanting Alpert to go for a couple box watches years now box watches as we’ve wondered if the ageless Others came to The Island via the box slave box ship. Another reading of Richard’s third way as a metaphor for bell ross watch Lost’s bell ross watch storytelling.


3/14/2010 7:25:25 PM

baume mercier said....

We won’t lead you astray, but we’re not going the way you bell ross expect.We’ll bell ross be doing this answer thing our way. Richard stormed into swiss rolex watch the bowels swiss rolex watch of the Black Rock and into its proverbial hurt locker—the place swiss rolex watches where military swiss rolex watches folk keep their explosives. The term hurt locker also swiss rolex refers to any swiss rolex place or situation where the soldier feels fundamentally unsafe. Both baume mercier watch terms applied to baume mercier watch Richard


3/14/2010 7:31:38 PM

breguet watches said....

He was profoundly betrayed by Jacob’s baume mercier watches death, scared baume mercier watches out of his eyelashes by Smokey, and just a massive baume mercier existential mess baume mercier in general. He wanted out—and by out, I mean he wanted breguet watch Jack to blow breguet watch him up with dynamite because he breguet watches couldn’t do breguet watches the deed himself. He explained as breguet he stripped bregue some fuse


3/14/2010 7:37:05 PM

dfdf said....

He nailed John Legend's superocean heritage chronographe Everybody Knows superocean heritage chronographe last week, and a command replica watches performance replica watches of a Robin Thicke tune might cement his blue-eyed replica watch soul bona replica watch fides. All day long, I’ve been getting curious emails fake watches and tweets fake watches from readers of our weekly Lost recaps blasting me with breitling Black Rock breitling dynamite for not discussing a pretty monumental moment in last night’s episode.


3/15/2010 1:24:13 AM

replica breitling said....

Jack and Richard’s discussion of breitling watch Jacob’s magical breitling watch touching and supernatural gifts in the dark belly of the breitling watches Black Rock breitling watches slave ship. Honestly, I ignored the first few replica breitling dozen of replica breitling these emails. Whaddya mean? I wrote 1500 words breitling replica about all breitling replica this! But after getting replica breitling watches another raft replica breitling watches of critical emails.


3/15/2010 1:28:11 AM

replica breitling said....

I checked out the recap and made a discovery a lange sohne replica that made a lange sohne replica me want to blow my own bad replica a lange sohne watch self up: Somehow replica a lange sohne watch, my Black Rock analysis if you can call what I do analysis replica a lange sohne watches wasn’t there replica a lange sohne watches! I apologize and blame myself. I write and submit various drafts of the recap replica a lange sohne during the night, and replica a lange sohne amid the confusion I create, this section slipped alain silberstein replica through the alain silberstein replica cracks.


3/15/2010 1:31:19 AM



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



So, you Human...?