AutoMapper 15.1.3
Prefix ReservedSee the version list below for details.
dotnet add package AutoMapper --version 15.1.3
NuGet\Install-Package AutoMapper -Version 15.1.3
<PackageReference Include="AutoMapper" Version="15.1.3" />
<PackageVersion Include="AutoMapper" Version="15.1.3" />
<PackageReference Include="AutoMapper" />
paket add AutoMapper --version 15.1.3
#r "nuget: AutoMapper, 15.1.3"
#:package AutoMapper@15.1.3
#addin nuget:?package=AutoMapper&version=15.1.3
#tool nuget:?package=AutoMapper&version=15.1.3
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:
- Collection Extensions
- Expression Mapping
- EF6 Extensions
- IDataReader/Record Extensions
- Enum Extensions
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
services.AddAutoMapper(cfg =>
{
cfg.CreateMap<Foo, FooDto>();
cfg.CreateMap<Bar, BarDto>();
});
// 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
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.Bcl.HashCode (>= 6.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Options (>= 8.0.0)
- Microsoft.IdentityModel.JsonWebTokens (>= 8.14.0)
- System.Reflection.Emit (>= 4.7.0)
-
net8.0
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Options (>= 8.0.0)
- Microsoft.IdentityModel.JsonWebTokens (>= 8.14.0)
-
net9.0
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Options (>= 8.0.0)
- Microsoft.IdentityModel.JsonWebTokens (>= 8.14.0)
NuGet packages (3.8K)
Showing the top 5 NuGet packages that depend on AutoMapper:
| Package | Downloads |
|---|---|
|
AutoMapper.Extensions.Microsoft.DependencyInjection
AutoMapper extensions for ASP.NET Core |
|
|
AutoMapper.Collection
Collection Add/Remove/Update support for AutoMapper. AutoMapper.Collection adds EqualityComparison Expressions for TypeMaps to determine if Source and Destination type are equivalent to each other when mapping collections. |
|
|
AutoMapper.Extensions.ExpressionMapping
Expression mapping (OData) extensions for AutoMapper |
|
|
AutoMapper.Extensions.EnumMapping
Convention-based enum value mapping extension for AutoMapper. |
|
|
DH.Core
DH框架基类核心库 |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 16.1.1 | 373,866 | 3/13/2026 | |
| 16.1.0 | 166,737 | 3/3/2026 | |
| 16.0.0 | 1,889,589 | 12/3/2025 | |
| 16.0.0-beta-1 | 8,442 | 11/20/2025 | |
| 15.1.3 | 8,494 | 3/18/2026 | |
| 15.1.0 | 1,396,041 | 10/24/2025 | |
| 15.0.1 | 3,679,027 | 7/11/2025 | |
| 14.0.0 | 36,200,733 | 2/14/2025 | |
| 13.0.1 | 131,810,219 | 2/7/2024 | |
| 12.0.1 | 131,468,676 | 1/16/2023 | |
| 12.0.0 | 65,963,405 | 9/30/2022 | |
| 11.0.1 | 59,210,368 | 2/4/2022 | |
| 11.0.0 | 34,468,118 | 1/5/2022 | |
| 10.1.1 | 156,614,834 | 10/16/2020 | |
| 10.0.0 | 45,571,120 | 7/1/2020 |