Today I was mentoring a younger dev, and he asked about how to handle data mapping between model and DTO classes. I advised him to use Automapper, which I find to be a quite simple solution for rather time consuming mapping task. I just couldn’t find any decent guide for VB.NET & Automapper start-up, so I decided to write my own.
Add NuGet package
For this example I created two classes which are mapped: Person and PersonDTO
And here’s the result:
Using Automapper is very easy and I hope this VB.NET example is useful to get started with it.