Syntrony.Mapping
1.1.0
dotnet add package Syntrony.Mapping --version 1.1.0
NuGet\Install-Package Syntrony.Mapping -Version 1.1.0
<PackageReference Include="Syntrony.Mapping" Version="1.1.0" />
<PackageVersion Include="Syntrony.Mapping" Version="1.1.0" />
<PackageReference Include="Syntrony.Mapping" />
paket add Syntrony.Mapping --version 1.1.0
#r "nuget: Syntrony.Mapping, 1.1.0"
#:package Syntrony.Mapping@1.1.0
#addin nuget:?package=Syntrony.Mapping&version=1.1.0
#tool nuget:?package=Syntrony.Mapping&version=1.1.0
Syntrony.Mapping
Object-to-object mapping contracts for the Syntrony framework — the attributes and interfaces, with zero mapping engine behind them.
This package only declares the surface: IObjectMapper, the [AutoMapFrom]/[AutoMapTo]/[AutoMap]/[IgnoreMap] attributes, and the fluent configuration contracts (IMapperConfigurationExpression, IMappingExpression<,>, IMemberConfigurationExpression<,,>). It has no dependency on AutoMapper, EF Core, or ASP.NET Core — it can be referenced from a console app, a worker, or a class library with no runtime cost.
To actually map anything, install an engine package alongside it:
| Package | Engine |
|---|---|
Syntrony.Mapping.AutoMapper |
AutoMapper 14.x (v1, current) |
Why the split
AutoMapper went commercial on 2 de julio de 2025 (Lucky Penny Software). Rather than depend on it directly, Syntrony.Mapping defines its own contracts under its own names, and a separate adapter package implements them on top of whichever engine is installed. Changing the engine later means swapping the installed package, not rewriting call sites. The public contracts here never expose a single AutoMapper type — verified by building Syntrony.Mapping with zero reference to the AutoMapper NuGet package.
Migration rule
If you're moving a mapping file from AutoMapper or Abp.AutoMapper, the goal is that the only line that changes is the using:
- using AutoMapper;
+ using Syntrony.Mapping;
internal static class DtoMappings
{
public static void Map(IMapperConfigurationExpression mapper) // signature unchanged
{
mapper.CreateMap<CreateAppInput, OpeApplication>()
.ForMember(d => d.ClientId, opt => opt.MapFrom(s => Guid.NewGuid()));
}
}
Every public type here keeps the exact name it has in AutoMapper or in Abp.AutoMapper — that's a design constraint, not a coincidence.
Supported subset (v1)
| Member | Included |
|---|---|
IObjectMapper.Map<TDestination>(object) / Map<TSource,TDestination>(source, destination) / ProjectTo<TDestination>(IQueryable) |
Yes |
[AutoMapFrom], [AutoMapTo], [AutoMap], [IgnoreMap] |
Yes |
CreateMap, ForMember (MapFrom as an expression — including zero-arg factories like s => Guid.NewGuid() — Ignore, UseValue, Condition, NullSubstitute), ReverseMap, ConvertUsing |
Yes |
MemberList on the attributes |
Yes |
ForPath, ForAllMembers, AutoMapKeyAttribute, custom IValueResolver/ITypeConverter on the public contract |
No — no known consumer; would leak the underlying engine's types into this contract |
[IgnoreMap] is applied on whichever side the property is declared: as a destination member it excludes the
member from both the mapping and MemberList.Destination validation; as a source member it excludes it from
MemberList.Source validation. It works the same for pairs declared by attribute and for fluent pairs. An
explicit ForMember on the same member wins — what's written by hand overrides what's inherited from the
attribute. ReverseMap() does not propagate the exclusion — the reverse map is a different pair.
Known limitation: a pair is either attribute-declared or fluent-declared, not both
[AutoMapFrom]/[AutoMapTo]/[AutoMap] and a fluent CreateMap<TSource,TDestination>() for the same type pair don't compose — the AutoMapper v1 engine treats that as a duplicate map registration and fails at startup with a clear error naming both types. If a pair needs a ForMember override, configure that whole pair fluently and don't also decorate it with an attribute. This is a real constraint of delegating to AutoMapper (not a bug we chose not to fix — see Syntrony.Mapping.AutoMapper's test suite for the exact scenario), and would need re-verifying if the engine ever changes.
Credit
The public API here is deliberately shaped after ASP.NET Boilerplate (MIT), which this package replaces:
IObjectMappermirrorsAbp.ObjectMapping.IObjectMapperandAbp.AutoMapper.AutoMapperObjectMapper(src/Abp.AutoMapper/AutoMapper/AutoMapperObjectMapper.cs) — same three members, same names.AutoMapFromAttribute,AutoMapToAttribute,AutoMapAttributeand theirMemberListparameter mirrorsrc/Abp.AutoMapper/AutoMapper/AutoMapFromAttribute.cs,AutoMapToAttribute.csandAutoMapAttribute.cs— same constructors, sameMemberListdefaults per direction (AutoMapFrom→Destination,AutoMapTo→Source).- The attribute-to-pair resolution in
Syntrony.Mapping.AutoMapper'sAttributeMappingScannerreproduces the algorithm inAutoMapAttributeBase.CreateMapandAbpAutoMapperModule.FindAndAutoMapTypes(src/Abp.AutoMapper/AutoMapper/AbpAutoMapperModule.cs), including which side of a pair getsMemberList.SourcevsMemberList.Destination.
None of ASP.NET Boilerplate's source is copied verbatim — the contracts here are independent types with no dependency on ABP or on AutoMapper — but the shape, names and defaults are intentionally identical so that migrating a project already using Abp.AutoMapper costs a using line, not a rewrite.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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 was computed. 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. |
-
net8.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Syntrony.Mapping:
| Package | Downloads |
|---|---|
|
Syntrony.Mapping.AutoMapper
AutoMapper engine adapter for Syntrony.Mapping |
GitHub repositories
This package is not used by any popular GitHub repositories.