OttoMapper.Mapping
1.0.2
dotnet add package OttoMapper.Mapping --version 1.0.2
NuGet\Install-Package OttoMapper.Mapping -Version 1.0.2
<PackageReference Include="OttoMapper.Mapping" Version="1.0.2" />
<PackageVersion Include="OttoMapper.Mapping" Version="1.0.2" />
<PackageReference Include="OttoMapper.Mapping" />
paket add OttoMapper.Mapping --version 1.0.2
#r "nuget: OttoMapper.Mapping, 1.0.2"
#:package OttoMapper.Mapping@1.0.2
#addin nuget:?package=OttoMapper.Mapping&version=1.0.2
#tool nuget:?package=OttoMapper.Mapping&version=1.0.2
OttoMapper
OttoMapper is a fast object mapping library for .NET with an API that is intentionally close to common AutoMapper usage patterns.
Why "Otto"?
Otto is a quintessentially German name — and so is the author. OttoMapper is a lightweight alternative to AutoMapper, so think of it as the Teutonic take on object mapping. A pun, basically.
Packages
OttoMapper.Mapping- core mapping engineOttoMapper.Extensions- dependency injection integration for ASP.NET Core
Features
CreateMap<TSource, TDestination>()ProfilesupportRequireExplicitMapsAssertConfigurationIsValid()- nested mapping
- collection mapping
ForMember(..., opt => opt.MapFrom(...))Ignore()Condition(...)NullSubstitute(...)ReverseMap()ForPath(...)BeforeMap(...)andAfterMap(...)ConvertUsing(...)ConstructUsing(...)Map<TDestination>(object source)
Basic usage
var config = new MapperConfiguration(cfg =>
{
cfg.RequireExplicitMaps = true;
cfg.CreateMap<AddressSource, AddressDestination>();
cfg.CreateMap<OrderSource, OrderDestination>()
.ForMember(d => d.Name, opt => opt.MapFrom(s => s.DisplayName))
.ForMember(d => d.Description, opt =>
{
opt.Condition(s => !string.IsNullOrWhiteSpace(s.Description));
opt.NullSubstitute("n/a");
opt.MapFrom(s => s.Description);
})
.ReverseMap();
});
config.AssertConfigurationIsValid();
var mapper = config.BuildMapper();
var dto = mapper.Map<OrderDestination>(source);
ASP.NET Core
builder.Services.AddOttoMapper(typeof(MyProfile).Assembly);
or
builder.Services.AddOttoMapper(cfg =>
{
cfg.RequireExplicitMaps = true;
}, typeof(MyProfile).Assembly);
Notes
OttoMapper is not a drop-in replacement for AutoMapper. It targets API compatibility with AutoMapper 14 for the most common mapping scenarios — CreateMap, profiles, ForMember/ForPath, conditions, reverse maps, hooks, nested and collection mapping — but it deliberately does not aim for full feature parity. If your project uses only the common subset of AutoMapper 14's API, migrating to OttoMapper should require minimal effort.
License
OttoMapper is licensed under the MIT License. See the LICENSE file in the repository root for the full license text.
Repository
| 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 is compatible. 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 | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | 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.1
- No dependencies.
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on OttoMapper.Mapping:
| Package | Downloads |
|---|---|
|
OttoMapper.Extensions
Dependency injection and ASP.NET Core integration package for OttoMapper with assembly scanning for profiles. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Added case-insensitive property mapping (default on) and underscore-ignoring property name matching (e.g. EMails_ID → EmailsId, default on). Compatible with AutoMapper 14 naming conventions.