Creating and using a ViewModel with AutoMapper

In this recipe, you will learn how to create and use ViewModel with AutoMapper. AutoMapper is a convention-based object-to-object mapper library (according to http://automapper.org/). We usually use AutoMapper to create ViewModel, Data Transfer Objects (DTO), and more classes from DataModel classes. AutoMapper makes it very easy to instantiate a class and fill the properties from other classes.

Get ASP.NET Core MVC 2.0 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.