AutoMapper 17.0.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?

The simplest way is to set an environment variable (AutoMapper 16.2.0 and later), with no code change needed:

  • AUTOMAPPER_LICENSE_KEY: the AutoMapper license key.
  • LUCKYPENNY_LICENSE_KEY: a key shared across Lucky Penny products. It must be for a license that includes AutoMapper.

Or you can set the license key in code when registering AutoMapper, which takes precedence over the environment variables:

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

See License configuration for all the options.

You can register for your license key at AutoMapper.io

Showing the top 20 packages that depend on AutoMapper.

Packages Downloads
KubernetesClient
Client library for the Kubernetes open source container orchestrator.
59
KubernetesClient
Client library for the Kubernetes open source container orchestrator.
58
KubernetesClient
Client library for the Kubernetes open source container orchestrator.
57
KubernetesClient.Models
Client library for the Kubernetes open source container orchestrator.
57
KubernetesClient
Client library for the Kubernetes open source container orchestrator.
56
KubernetesClient
Client library for the Kubernetes open source container orchestrator.
55
KubernetesClient
Client library for the Kubernetes open source container orchestrator.
54
KubernetesClient
Client library for the Kubernetes open source container orchestrator.
53
KubernetesClient.Models
Client library for the Kubernetes open source container orchestrator.
53

Version Downloads Last updated
17.0.0 3 11/13/2026
16.3.0 17 11/5/2026
16.2.0 46 7/3/2026
16.1.1 46 3/14/2026
16.1.0 45 3/11/2026
16.0.0 50 12/11/2025
16.0.0-beta-1 46 12/12/2025
15.1.4 11 11/5/2026
15.1.3 43 3/20/2026
15.1.2 41 3/17/2026
15.1.1 33 3/17/2026
15.1.0 50 12/11/2025
15.0.1 52 12/11/2025
15.0.0 44 1/4/2026
14.0.0 48 12/11/2025
13.0.1 40 12/11/2025
13.0.0 39 1/4/2026
12.0.1 52 12/11/2025
12.0.0 50 12/11/2025
11.0.1 43 12/11/2025
11.0.0 34 12/11/2025
10.1.1 45 12/11/2025
10.1.0 49 1/4/2026
10.0.0 52 12/11/2025
9.0.0 45 12/12/2025
8.1.1 52 12/12/2025
8.1.0 58 12/12/2025
8.0.0 55 12/12/2025
7.0.1 49 12/12/2025
7.0.0 50 1/4/2026
7.0.0-alpha-0001 47 12/12/2025
6.2.2 57 12/12/2025
6.2.1 51 12/12/2025
6.2.0 48 12/12/2025
6.1.1 47 12/12/2025
6.1.0 44 12/12/2025
6.0.2 43 12/12/2025
6.0.1 49 1/4/2026
6.0.0 43 1/4/2026
5.2.0 47 12/12/2025
5.1.1 49 12/12/2025
5.1.0 47 1/4/2026
5.0.2 48 12/12/2025
5.0.1 47 1/4/2026
5.0.0 44 1/4/2026
5.0.0-beta-1 54 12/12/2025
4.2.1 49 12/12/2025
4.2.0 48 12/11/2025
4.1.1 51 12/12/2025
4.1.0 46 1/4/2026
4.0.4 58 12/12/2025
4.0.3 49 1/4/2026
4.0.2 48 1/4/2026
4.0.1 43 1/4/2026
4.0.0 49 1/4/2026
4.0.0-ci1061 48 1/4/2026
4.0.0-ci1057 55 1/4/2026
4.0.0-ci1056 51 1/4/2026
4.0.0-ci1054 55 1/4/2026
4.0.0-ci1053 48 1/4/2026
4.0.0-ci1052 53 1/4/2026
4.0.0-ci1051 46 1/4/2026
4.0.0-ci1050 39 1/4/2026
4.0.0-ci1049 51 1/4/2026
4.0.0-ci1046 53 1/4/2026
4.0.0-ci1038 52 1/4/2026
4.0.0-ci1036 52 1/4/2026
4.0.0-ci1034 50 1/4/2026
4.0.0-ci1032 54 1/4/2026
4.0.0-ci1031 51 1/4/2026
4.0.0-ci1026 51 1/4/2026
4.0.0-ci1021 53 1/4/2026
4.0.0-ci1020 52 1/4/2026
4.0.0-ci1019 44 1/4/2026
4.0.0-ci1018 46 1/4/2026
4.0.0-ci1017 55 1/4/2026
4.0.0-ci1015 50 1/4/2026
4.0.0-ci1014 45 1/4/2026
4.0.0-ci1007 46 1/4/2026
4.0.0-ci1006 49 1/4/2026
4.0.0-ci1004 48 1/4/2026
4.0.0-ci1002 58 1/4/2026
4.0.0-alpha1 43 12/11/2025
3.3.1 49 12/11/2025
3.3.0 61 12/12/2025
3.3.0-ci1033 50 1/4/2026
3.3.0-ci1032 51 1/4/2026
3.3.0-ci1031 52 1/4/2026
3.3.0-ci1030 45 1/4/2026
3.3.0-ci1029 50 1/4/2026
3.3.0-ci1028 49 1/4/2026
3.3.0-ci1027 42 1/4/2026
3.3.0-ci1026 52 1/4/2026
3.3.0-ci1025 48 1/4/2026
3.3.0-ci1024 55 1/4/2026
3.3.0-ci1023 43 1/4/2026
3.3.0-ci1022 48 1/4/2026
3.3.0-ci1021 49 1/4/2026
3.3.0-ci1020 47 1/4/2026
3.3.0-ci1019 52 1/4/2026
3.3.0-ci1018 42 1/4/2026
3.3.0-ci1017 50 1/4/2026
3.3.0-ci1016 54 1/4/2026
3.3.0-ci1009 56 1/4/2026
3.3.0-ci1008 51 1/4/2026
3.3.0-ci1007 47 1/4/2026
3.3.0-ci1006 49 1/4/2026
3.3.0-ci1005 49 1/4/2026
3.3.0-ci1004 53 1/4/2026
3.3.0-ci1003 46 1/4/2026
3.3.0-ci1002 63 1/4/2026
3.3.0-ci1001 45 1/4/2026
3.3.0-ci1000 50 1/4/2026
3.2.1 48 12/12/2025
3.2.1-ci1002 52 1/4/2026
3.2.1-ci1001 45 1/4/2026
3.2.1-ci1000 36 1/4/2026
3.2.0 42 1/4/2026
3.2.0-ci1043 45 1/4/2026
3.2.0-ci1042 44 1/4/2026
3.2.0-ci1041 46 1/4/2026
3.2.0-ci1040 46 1/4/2026
3.2.0-ci1039 48 1/4/2026
3.2.0-ci1038 49 1/4/2026
3.2.0-ci1037 47 1/4/2026
3.2.0-ci1036 46 1/4/2026
3.2.0-ci1035 48 1/4/2026
3.2.0-ci1034 42 1/4/2026
3.2.0-ci1033 50 1/4/2026
3.2.0-ci1030 44 1/4/2026
3.2.0-ci1029 49 1/4/2026
3.2.0-ci1028 45 1/4/2026
3.2.0-ci1027 50 1/4/2026
3.2.0-ci1026 43 1/4/2026
3.2.0-ci1025 49 1/4/2026
3.2.0-ci1024 47 1/4/2026
3.2.0-ci1023 47 1/4/2026
3.2.0-ci1022 44 1/4/2026
3.2.0-ci1021 47 1/4/2026
3.2.0-ci1017 46 1/4/2026
3.2.0-ci1016 46 1/4/2026
3.2.0-ci1015 52 1/4/2026
3.2.0-ci1014 43 1/4/2026
3.2.0-ci1011 45 1/4/2026
3.2.0-ci1010 42 1/4/2026
3.2.0-ci1009 54 1/4/2026
3.2.0-ci1008 43 1/4/2026
3.2.0-ci1005 54 1/4/2026
3.2.0-ci1004 58 1/4/2026
3.2.0-ci1003 47 1/4/2026
3.2.0-ci1002 43 1/4/2026
3.2.0-ci1001 45 1/4/2026
3.2.0-ci1000 42 1/4/2026
3.1.1 46 12/12/2025
3.1.1-ci1003 45 1/4/2026
3.1.1-ci1000 45 1/4/2026
3.1.0 52 12/12/2025
3.1.0-ci1058 47 1/4/2026
3.1.0-ci1056 57 1/4/2026
3.1.0-ci1053 53 1/4/2026
3.1.0-ci1051 48 1/4/2026
3.1.0-ci1050 48 1/4/2026
3.1.0-ci1049 50 1/4/2026
3.1.0-ci1048 50 1/4/2026
3.1.0-ci1047 44 1/4/2026
3.1.0-ci1046 57 1/4/2026
3.1.0-ci1045 47 1/4/2026
3.1.0-ci1044 50 1/4/2026
3.1.0-ci1043 47 1/4/2026
3.1.0-ci1038 46 1/4/2026
3.1.0-ci1037 50 1/4/2026
3.1.0-ci1036 48 1/4/2026
3.1.0-ci1035 51 1/4/2026
3.1.0-ci1034 48 1/4/2026
3.1.0-ci1033 51 1/4/2026
3.1.0-ci1032 47 1/4/2026
3.1.0-ci1027 48 1/4/2026
3.1.0-ci1026 57 1/4/2026
3.1.0-ci1024 62 1/4/2026
3.1.0-ci1023 51 1/4/2026
3.1.0-ci1022 51 1/4/2026
3.1.0-ci1021 47 1/4/2026
3.1.0-ci1020 53 1/4/2026
3.1.0-ci1019 48 1/4/2026
3.1.0-ci1018 52 1/4/2026
3.1.0-ci1017 52 1/4/2026
3.1.0-ci1016 54 1/4/2026
3.1.0-ci1014 43 1/4/2026
3.0.0 49 12/12/2025
3.0.0-ci1053 50 1/4/2026
3.0.0-ci1043 50 1/4/2026
3.0.0-ci1042 57 1/4/2026
3.0.0-ci1041 55 1/4/2026
3.0.0-ci1040 48 1/4/2026
3.0.0-ci1039 55 1/4/2026
3.0.0-ci1038 46 1/4/2026
3.0.0-ci1037 53 1/4/2026
3.0.0-ci1036 50 1/4/2026
3.0.0-ci1035 50 1/4/2026
3.0.0-ci1034 47 1/4/2026
3.0.0-ci1033 48 1/4/2026
3.0.0-ci1032 49 1/4/2026
3.0.0-ci1031 50 1/4/2026
3.0.0-ci1029 48 1/4/2026
3.0.0-ci1028 48 1/4/2026
3.0.0-ci1026 48 1/4/2026
2.2.25-ci 45 1/4/2026
2.2.24-ci 46 1/4/2026
2.2.1 48 12/12/2025
2.2.1-ci9006 46 1/4/2026
2.2.1-ci9005 43 1/4/2026
2.2.1-ci9004 43 1/4/2026
2.2.1-ci9003 46 1/4/2026
2.2.1-ci9002 48 1/4/2026
2.2.1-ci9001 48 1/4/2026
2.2.1-ci9000 48 1/4/2026
2.2.1-ci9 42 1/4/2026
2.2.1-ci8 44 1/4/2026
2.2.1-ci7 45 1/4/2026
2.2.1-ci6 52 1/4/2026
2.2.1-ci5 42 1/4/2026
2.2.1-ci4 43 1/4/2026
2.2.1-ci17 50 1/4/2026
2.2.1-ci16 47 1/4/2026
2.2.1-ci11 42 1/4/2026
2.2.1-ci1000 46 1/4/2026
2.2.1-ci10 55 1/4/2026
2.2.0 42 12/12/2025
2.1.267 59 12/11/2025
2.1.266 44 12/11/2025
2.1.265 50 12/11/2025
2.1.262 51 12/11/2025
2.1.1 48 12/12/2025
2.0.0 48 12/12/2025
1.1.2 47 12/12/2025
1.1.1 46 1/4/2026
1.1.0.118 53 12/11/2025