AutoMapper 16.1.0

AutoMapper

CI NuGet Documentation Status

What is AutoMapper?

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?

This is the main repository for AutoMapper, but there's more:

How do I get started?

First, configure AutoMapper to know what types you want to map, in the startup of your application:

var configuration = new MapperConfiguration(cfg => 
{
    cfg.CreateMap<Foo, FooDto>();
    cfg.CreateMap<Bar, BarDto>();
}, loggerFactory);

// or more typically, using IServiceCollection with automatic service registration
services.AddAutoMapper(cfg => 
{
    cfg.CreateMap<Foo, FooDto>();
    cfg.CreateMap<Bar, BarDto>();
});
// AutoMapper will automatically register any implementations of:
// - IValueResolver<TSource, TDestination, TDestMember>
// - IMemberValueResolver<TSource, TDestination, TSourceMember, TDestMember>
// - ITypeConverter<TSource, TDestination>
// - IValueConverter<TSourceMember, TDestinationMember>
// - ICondition<TSource, TDestination, TDestMember>
// - IPreCondition<TSource, TDestination>
// - IMappingAction<TSource, TDestination>
// from the provided assemblies

// only during development, validate your mappings; remove it before release
#if DEBUG
configuration.AssertConfigurationIsValid();
#endif
// use DI (http://docs.automapper.io/en/latest/Dependency-injection.html) or create the mapper yourself
var mapper = configuration.CreateMapper();

Then in your application code, execute the mappings:

var fooDto = mapper.Map<FooDto>(foo);
var barDto = mapper.Map<BarDto>(bar);

Check out the getting started guide. When you're done there, the wiki goes in to the nitty-gritty details. If you have questions, you can post them to Stack Overflow.

Where can I get it?

First, install NuGet. Then, install AutoMapper from the package manager console:

PM> Install-Package AutoMapper

Or from the .NET CLI as:

dotnet add package AutoMapper

Do you have an issue?

You might want to know exactly what your mapping does at runtime.

If you're still running into problems, file an issue above.

If you are a paying customer, you can contact support via your account.

How do I set the license key?

You can set the license key when registering AutoMapper:

services.AddAutoMapper(cfg => 
{
    cfg.LicenseKey = "<license key here>";
})

You can register for your license key at AutoMapper.io

Showing the top 20 packages that depend on AutoMapper.

Packages Downloads
AutoMapper
A convention-based object-object mapper. AutoMapper uses a fluent configuration API to define an object-object mapping strategy. AutoMapper uses a convention-based matching algorithm to match up source to destination values. Currently, AutoMapper is geared towards model projection scenarios to flatten complex object models to DTOs and other simple objects, whose design is better suited for serialization, communication, messaging, or simply an anti-corruption layer between the domain and application layer.
124

Version Downloads Last updated
16.1.0 124 03/11/2026
16.0.0 114 03/11/2026
16.0.0-beta-1 124 03/11/2026
15.1.0 124 03/11/2026
15.0.1 126 03/11/2026
15.0.0 124 03/11/2026
14.0.0 124 03/11/2026
13.0.1 124 03/11/2026
13.0.0 125 03/11/2026
12.0.1 124 03/11/2026
12.0.0 124 03/11/2026
11.0.1 124 03/11/2026
11.0.0 124 03/11/2026
10.1.1 124 03/11/2026
10.1.0 125 03/11/2026
10.0.0 124 03/11/2026
9.0.0 0 08/12/2019
8.1.1 0 06/03/2019
8.1.0 0 04/25/2019
8.0.0 0 11/17/2018
7.0.1 62 03/12/2026
7.0.0-alpha-0001 0 04/10/2018
6.2.2 62 03/12/2026
6.2.1 0 11/16/2017
6.2.0 0 11/09/2017
6.1.1 0 06/27/2017
6.1.0 0 06/14/2017
6.0.2 0 03/22/2017
5.2.0 0 11/23/2016
5.1.1 0 08/12/2016
5.1.0 1 03/11/2026
5.0.2 0 07/07/2016
5.0.0-beta-1 0 05/17/2016
4.2.1 0 02/24/2016
4.2.0 0 01/28/2016
4.1.1 0 10/26/2015
4.0.4 0 08/06/2015
4.0.0-ci1061 1 03/11/2026
4.0.0-ci1056 1 03/11/2026
4.0.0-ci1052 1 03/11/2026
4.0.0-ci1038 1 03/11/2026
4.0.0-ci1036 1 03/11/2026
4.0.0-ci1031 1 03/12/2026
4.0.0-ci1026 1 03/12/2026
4.0.0-ci1020 1 03/12/2026
4.0.0-ci1017 1 03/11/2026
4.0.0-ci1015 1 03/11/2026
4.0.0-ci1007 1 03/11/2026
4.0.0-ci1004 1 03/12/2026
4.0.0-ci1002 1 03/11/2026
4.0.0-alpha1 0 07/07/2015
3.3.1 0 01/29/2015
3.3.0 0 11/29/2014
3.3.0-ci1032 1 03/12/2026
3.3.0-ci1029 1 03/12/2026
3.3.0-ci1027 1 03/11/2026
3.3.0-ci1023 1 03/12/2026
3.3.0-ci1008 1 03/11/2026
3.3.0-ci1006 1 03/11/2026
3.3.0-ci1003 1 03/11/2026
3.3.0-ci1002 1 03/12/2026
3.3.0-ci1001 1 03/12/2026
3.2.1 0 04/25/2014
3.2.1-ci1000 1 03/11/2026
3.2.0-ci1033 1 03/12/2026
3.2.0-ci1025 1 03/11/2026
3.2.0-ci1023 1 03/11/2026
3.2.0-ci1004 1 03/12/2026
3.2.0-ci1002 1 03/11/2026
3.2.0-ci1000 1 03/12/2026
3.1.1 0 12/31/2013
3.1.1-ci1003 1 03/12/2026
3.1.0 0 11/17/2013
3.1.0-ci1053 1 03/11/2026
3.1.0-ci1051 1 03/12/2026
3.1.0-ci1050 1 03/12/2026
3.1.0-ci1049 1 03/12/2026
3.1.0-ci1047 1 03/12/2026
3.1.0-ci1045 1 03/11/2026
3.1.0-ci1044 1 03/12/2026
3.1.0-ci1033 1 03/11/2026
3.1.0-ci1027 1 03/11/2026
3.1.0-ci1018 1 03/11/2026
3.1.0-ci1017 1 03/11/2026
3.0.0 62 03/12/2026
3.0.0-ci1043 1 03/11/2026
3.0.0-ci1040 1 03/12/2026
3.0.0-ci1039 1 03/11/2026
3.0.0-ci1028 62 03/12/2026
3.0.0-ci1026 124 03/12/2026
2.2.25-ci 124 03/12/2026
2.2.24-ci 125 03/12/2026
2.2.1 124 03/12/2026
2.2.1-ci9006 124 03/12/2026
2.2.1-ci9005 124 03/12/2026
2.2.1-ci9004 124 03/12/2026
2.2.1-ci9003 124 03/12/2026
2.2.1-ci9002 124 03/12/2026
2.2.1-ci9001 124 03/12/2026
2.2.1-ci9000 124 03/12/2026
2.2.1-ci9 124 03/12/2026
2.2.1-ci8 124 03/12/2026
2.2.1-ci7 124 03/12/2026
2.2.1-ci6 124 03/12/2026
2.2.1-ci5 124 03/12/2026
2.2.1-ci4 124 03/12/2026
2.2.1-ci17 124 03/12/2026
2.2.1-ci16 124 03/12/2026
2.2.1-ci11 124 03/12/2026
2.2.1-ci1000 124 03/12/2026
2.2.1-ci10 124 03/12/2026
2.2.0 124 03/12/2026
2.1.267 124 03/12/2026
2.1.266 124 03/12/2026
2.1.265 124 03/12/2026
2.1.262 124 03/12/2026
2.1.1 124 03/12/2026
2.0.0 124 03/12/2026
1.1.2 124 03/12/2026
1.1.1 124 03/11/2026
1.1.0.118 124 03/11/2026