Automapper for .NET Core

Automapper for .NET Core

Author: Telerik April 3, 2017 Duration: 33:14
On this episode of Eat Sleep Code guest Jimmy Bogard shares his perspective on Microsoft's basic object-mapper. Jimmy talks about the future of Automapper and support for .NET Core & .NET Standard. 00:57 EC: So I wanted to get you on the show today, because of a GitHub issue I saw on the MVC GitHub repository. And this GitHub issue is… It reads, “Basic object mapper for simple model view. View model property mapping.” And I have a feeling that you have some opinions about this, having one of… A very popular NuGet package for ‘.NET’ AutoMapper. And it’s been quite successful. And this, to me, it looks like it may step on your toes a little bit. So I wanted to get you to talk about kinda where you’re at and how this affects you. But before we get started, why don’t you give everybody a quick introduction of who you are and what you do, Jimmy? 01:56 JB: Okay. I guess I really write code for customers for a living. I work at a consulting company called Headspring out of Austin, Texas. And nearly all of the open-source stuff I work on, is just stuff that I build to help my clients. It’s just tools I wanted to keep using, and using, and using as we go from client to client. And so, almost everything that I write and use these days with open-source is stuff I’m actually using on client projects, that I don’t wanna lose when I go to the next client. 02:33 EC: And you have this tool called AutoMapper, which is an object mapping tool. Why don’t we give everybody a quick elevator pitch. What is an object mapper? 02:46 JB: Well, the basic idea is I have two objects that look pretty similar, and my general use case was I’m building web applications in ASP.NET MVC, typically. And I have a rich domain model that’s bound to the database in some way or another, usually with an ORM, like in any framework. But then, I had this other thing I’m using to show information on the web, either for showing forms, or also posting data from the web. And you have this general problem, and that’s your backend object is generally very rich and behavioral, and has a lot of things associated with it, but the thing you’re coming in from the web, is generally not. And you typically don’t wanna mix those two things together. So about… Gosh, eight or nine years ago, I saw this issue of when we’re starting out MVC, that we wanted to have these DTOs that we use for the MVC side and have these rich backend objects. But what would be the mechanism that we copy that information from the rich backend objects to the frontend dumb DTO objects? And I didn’t wanna do that all by hand, and I looked around, and saw there really wasn’t anything that did it for you automatically. And so, I created AutoMapper as a way to automatically figure out how to copy information from one object to the other. 04:12 JB: Probably a stupid idea. That didn’t seem that complicated, but there were a few things that I wanted to have out of the box that would help us out. One of the big ones was flattening, so if you have “foo.bar.baz” on your destination object, you could just have a single property, “foo, bar, baz.” And it would automatically traverse those associations, and figure out how to flatten that object for you. It handled nulls as well. If foo was null or bar was null, it’d be able to handle that as well. And the other big thing that I wanted to do, was make sure we could test it as well. So if I misspelled something or removed a property, I could just have one line of… Just check all my configuration is valid, and all the names match up, and there’s nothing missing. And if there is, go in exception, so it’s really easy for us to test, to say, “Make sure all my mappings are good.” Find out more at http://developer.telerik.com/content-types/podcast/automapper-net-core/

Ever wonder what keeps other developers up at night, or what tools they're genuinely excited about? Eat Sleep Code Podcast pulls up a virtual chair for those conversations, hosted by Telerik. It's a space where the focus is on the people behind the code-their challenges, breakthroughs, and the topics that fuel their passion. You'll hear from a diverse mix of voices within the software development community, covering everything from emerging technologies and practical coding techniques to industry news and career insights. This isn't about dry lectures; it's about the shared experience of building things. As the official Telerik podcast, it stems from a core belief in giving back and fostering genuine connection. Tuning in feels like joining a discussion among peers who are just as curious as you are. Each episode offers a chance to step away from the screen and listen in on the ideas shaping our work, making this podcast a natural companion for your commute or coffee break. It’s about more than just the technical details-it’s about the stories and perspectives that define the daily life in development.
Author: Language: English Episodes: 100

Eat Sleep Code Podcast
Podcast Episodes
Guy Royse - Redis Beyond the Cache [not-audio_url] [/not-audio_url]

Duration: 1:15:07
On this episode of Eat Sleep Code, Guy Royse from Redis Labs talks about how Redis is used for more than just caching data. Guy discusses his passions for Big Foot, UFO encounters and D&D.
JD on Testing, Refactoring and Blogging [not-audio_url] [/not-audio_url]

Duration: 1:02:09
On this episode of Eat Sleep Code Jonathan Danylko [J.D.] talks about why he values unit testing and how it leads to assurances while refactoring code. J.D. discusses what it takes to maintain his .NET blog, danylkoweb.c…
John Bristowe Octopus Hunter [not-audio_url] [/not-audio_url]

Duration: 1:00:11
On this episode of Eat Sleep Code, John Bristowe talks about deploying software and managing the process with Octopus Deploy. John discusses his career in development, soft skills, and his hobby projects using Raspberry…
Layla Porter and Women of .NET [not-audio_url] [/not-audio_url]

Duration: 1:15:01
On this episode of Eat Sleep Code, Laya Porter a Developer Advocate form VMware® Tanzu® talks about her project Women of .NET. Twitch streaming, gaming and travel are discussed.
Tech Events Amid the Pandemic [not-audio_url] [/not-audio_url]

Duration: 1:06:56
On this episode of Eat Sleep Code, Ed Charbeneau and John Bristowe talk about the Tech Conferences initial response to the pandemic. Recorded 3.2.2020 https://www.theurlist.com/esc-news-3-2-2020
Eat Sleep News [not-audio_url] [/not-audio_url]

Duration: 1:03:34
On this episode of Eat Sleep Code, John Bristowe and Ed Charbeneau discuss software development and technology news from around the web. Links from this show: https://www.theurlist.com/esc-news-2-18-2020
Rock City A11y [not-audio_url] [/not-audio_url]

Duration: 44:36
On this episode of Eat Sleep Code, we talk to accessibility expect and front end developer Chris Demars. Chris discusses the current state of accessibility (a11y) on the web. We learn about common accessibility problems,…
Net Core on the Desktop [not-audio_url] [/not-audio_url]

Duration: 26:57
On this episode of Eat Sleep Code, guests Olia Gavrysh and Daniel Jacobson discuss how .NET Core 3 will improve the Windows Desktop app development landscape. We discuss application compatibility, and building bridges be…
Blazor a live QA with Daniel Roth at Build [not-audio_url] [/not-audio_url]

Duration: 43:47
On this episode of eat sleep code, ASP.NET PM Daniel Roth answers live questions about Blazor. Blazor is a new SPA framework by Microsoft that enables full stack C# web applications by leveraging WebAssembly. Daniel fill…
The Uno Platform And Web Assembly [not-audio_url] [/not-audio_url]

Duration: 40:57
On this episode of Eat Sleep Code, Jérôme Laban, Uno Platform CTO talks about the prospects of using Uno to create cross platform .NET applications. Jérôme also discusses the use of WebAssembly by Uno and what WebAssembl…