DEV Community

Diógenes Polanco
Diógenes Polanco

Posted on

the new features of AutoMapper in .net

Table Of Contents

    * [What is Automapper?](#Automapper)
    * [New features](#Features)
    * [Installation](#Installation)
    * [How to Use Automapper?](#AutomapperApplication) 
Enter fullscreen mode Exit fullscreen mode

What is Automapper?

AutoMapper is an object-object mapper. Object-object mapping works by transforming an input object of one type into an output object of a different type. What makes AutoMapper interesting is that it provides some interesting conventions to take the dirty work out of figuring out how to map type A to type B. As long as type B follows AutoMapper’s established convention, almost zero configuration is needed to map two types.

New features

    * Remove static API
Enter fullscreen mode Exit fullscreen mode



the way to do it now is:



* Remove dynamic maps



the way to do it now is:



* Update Conditional Mapping



* Help the runtime find the AM assembly

    * Match destination enumerable types with it's enumerable for LINQ
Enter fullscreen mode Exit fullscreen mode

Installation

The first step is to install the corresponding NuGet package:

dotnet add package AutoMapper --version 9.0.0   
Enter fullscreen mode Exit fullscreen mode

Now, what is the way to Use Automapper?

You can clone my code!

Top comments (2)

Collapse
 
mincasoft profile image
mincasoft

How to register as singleton in real app .NET Framework, such as WPF

Collapse
 
diogenespolanco profile image
Diógenes Polanco

Well this article does not talk about patterns but if you need to use Singleton in .net I recommend using this autofaccn.readthedocs.io/en/latest... package that will help you implement dependency injection.

You can install it from nuget:
dotnet add package Autofac