A convention-based object-object mapper in .NET.
A convention-based object-object mapper in .NET.
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:
First, configure AutoMapper to know what types you want to map, in the startup of your application:
…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.
First, install NuGet. Then, install AutoMapper from the package manager console:
PM> Install-Package AutoMapperOr from the .NET CLI as:
dotnet add package AutoMapperYou 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.
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
License key validation: handle common key problems (whitespace, truncation, client platforms) in AutoMapper and MediatR
Blazor WASM: PlatformNotSupportedException inside the validation result is logged as a critical signature error
Detect truncated or malformed license keys and log a clear message
Strip all whitespace from the license key
Registration order causes `ResolutionContext.OverTypeDepth` to access `Context.Items` in AutoMapper 16.2.0
Add env var license instructions to readme
Re-evaluate the AutoMapper.Internal surface
CheckForCycles removes the type map from typeMapsPath while its members are still being iterated
Execution plans are cached per type pair but bake in member-specific state
.NET Matrix