Skip to main content

Synthetix by Nertti Technologies

NuGet / site data​

Nuget GitHub last commit GitHub Repo stars

Details​

Info​

info

Name: Synthetix

A compile-time, source-generated object-to-object mapper for .NET. As fast as hand-written code, AOT friendly, with an auditable, drift-checked mapping manifest.

Author: Nertti Technologies

NuGet: https://www.nuget.org/packages/Synthetix/

You can find more details at https://github.com/Nertti-Technologies/Synthetix

Source: https://github.com/Nertti-Technologies/Synthetix

Author​

note

Nertti Technologies Alt text

Original Readme​

note
, source-generated object-to-object mapper for .NET

A compile-time, source-generated object-to-object mapper for .NET — as fast as hand-written code, with mappings that are auditable and drift-checked.

Synthetix turns the boring, error-prone job of copying values from one object to another into plain C# that the compiler writes for you. You declare a partial mapper class; a Roslyn source generator reads your types at build time and emits ordinary, readable mapping code into your project.

Because the mapping is generated while your project compiles, there is no runtime reflection, no expression-tree compilation, and no startup warm-up. The generated code is real C# you can set a breakpoint inside, and it works under Native AOT and assembly trimming with nothing extra to configure.

Synthetix focuses its effort on one thing those tools leave largely untouched: making the mapping itself something you can see, review, and trust — see the mapping manifest below.

Install​
<PackageReference Include="Synthetix" Version="0.1.0"
PrivateAssets="all" ExcludeAssets="runtime" />

The package contains only a source generator. Your built assembly carries no Synthetix dependency at runtime — nothing to load, trim, or version-conflict.

Quick start​

Declare a mapper. The methods are partial and have no body — Synthetix fills them in:

using Synthetix;

[Mapper]
public partial class OrderMapper
{
public partial OrderDto ToDto(Order order);
}

That is all. Call new OrderMapper().ToDto(order) and you get a fully mapped OrderDto. If a property cannot be mapped, your build fails with a precise error instead of shipping a silent null.

What Synthetix does​
  • Same-name mapping — properties with matching names and compatible types are mapped automatically.
  • Flattening / unflattening — Order.Customer.Name maps to OrderCustomerName and back, by naming convention.
  • Compile-time diagnostics — broken, incomplete, or ambiguous mappings become compiler errors and warnings (SYNTX001–SYNTX017) with exact source locations.
  • Custom member configuration — attributes to rename, ignore, supply constant values, or route a member through your own conversion method.
  • The mapping manifest — the capability Synthetix invests in most.
The mapping manifest​

For every mapper, Synthetix writes a mapping manifest — a readable record of every mapping decision (which source fed which target, which rule resolved it, what was ignored, and a coverage count). It is meant to be committed to source control, so a mapping becomes something a reviewer can read in a pull request.

On every build, Synthetix compares your committed manifest against the current mapping. If they differ — a newly unmapped field, a changed rule — it reports SYNTX017. Teams keep that a warning locally and an error in CI, so a change in mapping behaviour can never merge by accident. Refresh the manifest explicitly with:

dotnet build -t:SynthetixUpdateManifest

The manifest is on by default. Turn it off with <SynthetixManifest>false</SynthetixManifest>.

Build from source​

This repository contains the full solution (see docs/Synthetix-Design.md for the design):

dotnet build Synthetix.sln
dotnet test Synthetix.sln
dotnet run --project samples/Synthetix.Sample

Requires the .NET 10 SDK. The generator project itself targets netstandard2.0 because it is loaded into the compiler — that is a hard requirement, separate from the .NET 10 your own code targets.

License​

Apache 2.0 — see LICENSE.

About​

note

Generating audited object-to-object mapping code

How to use​

Example (source csproj, source files)​

This is the CSharp Project that references Synthetix

<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<PropertyGroup>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\GX</CompilerGeneratedFilesOutputPath>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Synthetix" Version="0.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>

Generated Files​

Those are taken from $(BaseIntermediateOutputPath)\GX

// <auto-generated/> This file was produced by Synthetix. Do not edit it.
#nullable enable

namespace SynthetixDemo
{
public partial class OrderMapper
{
public partial global::SynthetixDemo.OrderDto ToDto(global::SynthetixDemo.Order order)
{
var target = new global::SynthetixDemo.OrderDto();
target.Id = order.Id;
target.DisplayTotal = FormatMoney(order.Total);
target.CustomerName = order.Customer.Name;
target.CustomerEmail = order.Customer.Email;
return target;
}
}
}

Useful​

Download Example (.NET C#)​

Share Synthetix​

https://ignatandrei.github.io/RSCG_Examples/v2/docs/Synthetix

Category "Mapper" has the following generators:​

1 AutoDTO Nuget GitHub Repo stars 2023-08-24

2 AutoGen Nuget GitHub Repo stars 2024-02-22

3 DapperFluentMap Nuget GitHub Repo stars 2026-11-13

4 DevSource.ObjectMapping Nuget GitHub Repo stars 2026-11-16

5 DotNetBrightener.Mapper Nuget GitHub Repo stars 2026-11-14

6 DynamicsMapper Nuget GitHub Repo stars 2023-10-16

7 Facet Nuget GitHub Repo stars 2025-08-17

8 GenericDtoSourceGenerator Nuget GitHub Repo stars 2026-11-24

9 LightweightObjectMapper Nuget GitHub Repo stars 2024-09-18

10 lomapper Nuget GitHub Repo stars 2026-04-07

11 MagicMap Nuget GitHub Repo stars 2023-10-08

12 MapItEasy Nuget GitHub Repo stars 2026-09-10

13 Mappa.Generator Nuget GitHub Repo stars 2026-10-03

14 mapperly Nuget GitHub Repo stars 2023-04-16

15 MapTo Nuget GitHub Repo stars 2023-10-05

16 Najlot.Map.SourceGenerator Nuget GitHub Repo stars 2026-08-29

17 NextGenMapper Nuget GitHub Repo stars 2023-08-16

18 Synthetix Nuget GitHub Repo stars 2026-11-18

See category​

Mapper