AutoMapper 16.2.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.Extensions.Microsoft.DependencyInjection
AutoMapper extensions for ASP.NET Core
163
AutoMapper.Extensions.Microsoft.DependencyInjection
AutoMapper extensions for ASP.NET Core
164
AutoMapper.Extensions.Microsoft.DependencyInjection
AutoMapper extensions for ASP.NET Core
171
AutoMapper.Extensions.Microsoft.DependencyInjection
AutoMapper extensions for ASP.NET Core
190
AutoMapper.Extensions.Microsoft.DependencyInjection
AutoMapper extensions for ASP.NET Core
1,065
DHP.Core
Package Description
180
DHP.Core
Package Description
274
Duende.IdentityServer.EntityFramework.Storage
EntityFramework persistence layer for Duende IdentityServer
162
Duende.IdentityServer.EntityFramework.Storage
EntityFramework persistence layer for Duende IdentityServer
163
Duende.IdentityServer.EntityFramework.Storage
EntityFramework persistence layer for Duende IdentityServer
164
Duende.IdentityServer.EntityFramework.Storage
EntityFramework persistence layer for Duende IdentityServer
165
Duende.IdentityServer.EntityFramework.Storage
EntityFramework persistence layer for Duende IdentityServer
166
Duende.IdentityServer.EntityFramework.Storage
EntityFramework persistence layer for Duende IdentityServer
169
Duende.IdentityServer.EntityFramework.Storage
EntityFramework persistence layer for Duende IdentityServer
171
Duende.IdentityServer.EntityFramework.Storage
EntityFramework persistence layer for Duende IdentityServer
174
Nuke.Common
Cross-platform build automation system
163

Version Downloads Last updated
16.2.0 3 07/03/2026
16.1.1 74 03/13/2026
16.1.0 44 03/05/2026
16.0.0 96 12/04/2025
16.0.0-beta-1 72 11/21/2025
15.1.3 44 03/18/2026
15.1.2 49 03/17/2026
15.1.1 59 03/16/2026
15.1.0 121 10/24/2025
15.0.1 133 07/11/2025
15.0.0 110 07/03/2025
14.0.0 498 02/16/2025
13.0.1 572 02/13/2024
13.0.0 15 05/25/2026
12.0.1 579 02/04/2024
12.0.0 170 02/04/2024
11.0.1 154 07/22/2024
11.0.0 195 02/04/2024
10.1.1 193 02/09/2024
10.1.0 15 05/25/2026
10.0.0 137 07/13/2024
9.0.0 133 07/22/2024
8.1.1 130 07/22/2024
8.1.0 147 07/22/2024
8.0.0 130 07/22/2024
7.0.1 161 07/22/2024
7.0.0 13 05/25/2026
7.0.0-alpha-0001 154 07/22/2024
6.2.2 173 07/22/2024
6.2.1 132 07/22/2024
6.2.0 137 07/22/2024
6.1.1 143 07/22/2024
6.1.0 145 07/22/2024
6.0.2 130 07/18/2024
6.0.1 13 05/25/2026
6.0.0 15 05/25/2026
5.2.0 156 07/22/2024
5.1.1 137 07/18/2024
5.1.0 13 05/25/2026
5.0.2 153 07/22/2024
5.0.1 16 05/25/2026
5.0.0 13 05/25/2026
5.0.0-beta-1 151 07/22/2024
4.2.1 141 07/22/2024
4.2.0 160 07/22/2024
4.1.1 141 07/22/2024
4.1.0 16 05/25/2026
4.0.4 144 07/22/2024
4.0.3 15 05/25/2026
4.0.2 13 05/25/2026
4.0.1 14 05/25/2026
4.0.0 14 05/25/2026
4.0.0-ci1061 14 05/25/2026
4.0.0-ci1057 13 05/25/2026
4.0.0-ci1056 14 05/25/2026
4.0.0-ci1054 11 05/25/2026
4.0.0-ci1053 13 05/25/2026
4.0.0-ci1052 15 05/25/2026
4.0.0-ci1051 13 05/25/2026
4.0.0-ci1050 14 05/25/2026
4.0.0-ci1049 15 05/25/2026
4.0.0-ci1046 13 05/25/2026
4.0.0-ci1038 15 05/25/2026
4.0.0-ci1036 16 05/25/2026
4.0.0-ci1034 14 05/25/2026
4.0.0-ci1032 19 05/25/2026
4.0.0-ci1031 12 05/25/2026
4.0.0-ci1026 14 05/25/2026
4.0.0-ci1021 14 05/25/2026
4.0.0-ci1020 16 05/25/2026
4.0.0-ci1019 17 05/25/2026
4.0.0-ci1018 14 05/25/2026
4.0.0-ci1017 12 05/25/2026
4.0.0-ci1015 17 05/25/2026
4.0.0-ci1014 13 05/25/2026
4.0.0-ci1007 14 05/25/2026
4.0.0-ci1006 14 05/25/2026
4.0.0-ci1004 12 05/25/2026
4.0.0-ci1002 14 05/25/2026
4.0.0-alpha1 152 07/22/2024
3.3.1 142 07/22/2024
3.3.0 147 07/22/2024
3.3.0-ci1033 13 05/25/2026
3.3.0-ci1032 16 05/25/2026
3.3.0-ci1031 12 05/25/2026
3.3.0-ci1030 14 05/25/2026
3.3.0-ci1029 16 05/25/2026
3.3.0-ci1028 11 05/25/2026
3.3.0-ci1027 16 05/25/2026
3.3.0-ci1026 15 05/25/2026
3.3.0-ci1025 16 05/25/2026
3.3.0-ci1024 12 05/25/2026
3.3.0-ci1023 13 05/25/2026
3.3.0-ci1022 14 05/25/2026
3.3.0-ci1021 16 05/25/2026
3.3.0-ci1020 15 05/25/2026
3.3.0-ci1019 16 05/25/2026
3.3.0-ci1018 16 05/25/2026
3.3.0-ci1017 12 05/25/2026
3.3.0-ci1016 13 05/25/2026
3.3.0-ci1009 11 05/25/2026
3.3.0-ci1008 15 05/25/2026
3.3.0-ci1007 13 05/25/2026
3.3.0-ci1006 14 05/25/2026
3.3.0-ci1005 14 05/25/2026
3.3.0-ci1004 18 05/25/2026
3.3.0-ci1003 17 05/25/2026
3.3.0-ci1002 12 05/25/2026
3.3.0-ci1001 15 05/25/2026
3.3.0-ci1000 12 05/25/2026
3.2.1 138 07/22/2024
3.2.1-ci1002 15 05/25/2026
3.2.1-ci1001 13 05/25/2026
3.2.1-ci1000 9 05/25/2026
3.2.0 10 05/25/2026
3.2.0-ci1043 15 05/25/2026
3.2.0-ci1042 15 05/25/2026
3.2.0-ci1041 19 05/25/2026
3.2.0-ci1040 13 05/25/2026
3.2.0-ci1039 20 05/25/2026
3.2.0-ci1038 12 05/25/2026
3.2.0-ci1037 17 05/25/2026
3.2.0-ci1036 16 05/25/2026
3.2.0-ci1035 12 05/25/2026
3.2.0-ci1034 16 05/25/2026
3.2.0-ci1033 11 05/25/2026
3.2.0-ci1030 17 05/25/2026
3.2.0-ci1029 12 05/25/2026
3.2.0-ci1028 13 05/25/2026
3.2.0-ci1027 14 05/25/2026
3.2.0-ci1026 14 05/25/2026
3.2.0-ci1025 15 05/25/2026
3.2.0-ci1024 13 05/25/2026
3.2.0-ci1023 16 05/25/2026
3.2.0-ci1022 15 05/25/2026
3.2.0-ci1021 15 05/25/2026
3.2.0-ci1017 17 05/25/2026
3.2.0-ci1016 14 05/25/2026
3.2.0-ci1015 17 05/25/2026
3.2.0-ci1014 11 05/25/2026
3.2.0-ci1011 13 05/25/2026
3.2.0-ci1010 18 05/25/2026
3.2.0-ci1009 12 05/25/2026
3.2.0-ci1008 13 05/25/2026
3.2.0-ci1005 13 05/25/2026
3.2.0-ci1004 12 05/25/2026
3.2.0-ci1003 12 05/25/2026
3.2.0-ci1002 17 05/25/2026
3.2.0-ci1001 14 05/25/2026
3.2.0-ci1000 13 05/25/2026
3.1.1 164 07/22/2024
3.1.1-ci1003 11 05/25/2026
3.1.1-ci1000 14 05/25/2026
3.1.0 159 07/22/2024
3.1.0-ci1058 14 05/25/2026
3.1.0-ci1056 11 05/25/2026
3.1.0-ci1053 14 05/25/2026
3.1.0-ci1051 15 05/25/2026
3.1.0-ci1050 13 05/25/2026
3.1.0-ci1049 14 05/25/2026
3.1.0-ci1048 11 05/25/2026
3.1.0-ci1047 15 05/25/2026
3.1.0-ci1046 13 05/25/2026
3.1.0-ci1045 14 05/25/2026
3.1.0-ci1044 14 05/25/2026
3.1.0-ci1043 11 05/25/2026
3.1.0-ci1038 13 05/25/2026
3.1.0-ci1037 13 05/25/2026
3.1.0-ci1036 14 05/25/2026
3.1.0-ci1035 14 05/25/2026
3.1.0-ci1034 16 05/25/2026
3.1.0-ci1033 13 05/25/2026
3.1.0-ci1032 13 05/25/2026
3.1.0-ci1027 13 05/25/2026
3.1.0-ci1026 16 05/25/2026
3.1.0-ci1024 12 05/25/2026
3.1.0-ci1023 14 05/25/2026
3.1.0-ci1022 14 05/25/2026
3.1.0-ci1021 17 05/25/2026
3.1.0-ci1020 19 05/25/2026
3.1.0-ci1019 16 05/25/2026
3.1.0-ci1018 15 05/25/2026
3.1.0-ci1017 15 05/25/2026
3.1.0-ci1016 13 05/25/2026
3.1.0-ci1014 14 05/25/2026
3.0.0 142 07/22/2024
3.0.0-ci1053 13 05/25/2026
3.0.0-ci1043 14 05/25/2026
3.0.0-ci1042 16 05/25/2026
3.0.0-ci1041 16 05/25/2026
3.0.0-ci1040 14 05/25/2026
3.0.0-ci1039 15 05/25/2026
3.0.0-ci1038 16 05/25/2026
3.0.0-ci1037 18 05/25/2026
3.0.0-ci1036 12 05/25/2026
3.0.0-ci1035 14 05/25/2026
3.0.0-ci1034 14 05/25/2026
3.0.0-ci1033 13 05/25/2026
3.0.0-ci1032 16 05/25/2026
3.0.0-ci1031 12 05/25/2026
3.0.0-ci1029 14 05/25/2026
3.0.0-ci1028 14 05/25/2026
3.0.0-ci1026 14 05/25/2026
2.2.25-ci 14 05/25/2026
2.2.24-ci 14 05/25/2026
2.2.1 147 07/22/2024
2.2.1-ci9006 16 05/25/2026
2.2.1-ci9005 14 05/25/2026
2.2.1-ci9004 14 05/25/2026
2.2.1-ci9003 14 05/25/2026
2.2.1-ci9002 11 05/25/2026
2.2.1-ci9001 12 05/25/2026
2.2.1-ci9000 12 05/25/2026
2.2.1-ci9 10 05/25/2026
2.2.1-ci8 14 05/25/2026
2.2.1-ci7 12 05/25/2026
2.2.1-ci6 13 05/25/2026
2.2.1-ci5 16 05/25/2026
2.2.1-ci4 15 05/25/2026
2.2.1-ci17 14 05/25/2026
2.2.1-ci16 14 05/25/2026
2.2.1-ci11 13 05/25/2026
2.2.1-ci1000 11 05/25/2026
2.2.1-ci10 11 05/25/2026
2.2.0 140 07/22/2024
2.1.267 128 07/22/2024
2.1.266 132 07/22/2024
2.1.265 145 07/22/2024
2.1.262 162 07/22/2024
2.1.1 140 07/22/2024
2.0.0 156 07/22/2024
1.1.2 148 07/22/2024
1.1.1 11 05/25/2026
1.1.0.118 147 07/22/2024