A convention-based object-object mapper. 100% organic and gluten-free. Takes out all of the fuss of mapping one object to another. AutoMapper is a simple little library built to solve a deceptively complex problem, getting rid of code that mapped one object to another. This type of code is rather dreary and boring to write, so why not invent a tool to do it for us? First, install NuGet. Then, install AutoMapper from the package manager console. 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.
Features
- AutoMapper provides simple configuration of types, as well as simple testing of mappings
- AutoMapper works best as long as the names of the members match up to the source type’s members
- Async extension methods for ProjectTo
- Add, map to, and delete items in a collection by comparing items for matches
- AutoMapper.Collection.EF to support Equality by Primary Keys
- Persist methods to handle Insert/Update/Delete DTOs to the Entities