Synthetix 0.1.0

dotnet add package Synthetix --version 0.1.0
                    
NuGet\Install-Package Synthetix -Version 0.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Synthetix" Version="0.1.0">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Synthetix" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Synthetix">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Synthetix --version 0.1.0
                    
#r "nuget: Synthetix, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Synthetix@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Synthetix&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Synthetix&version=0.1.0
                    
Install as a Cake Tool

Synthetix

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 is not here to replace the good tools that already exist — Mapperly and AutoMapper are mature and well designed. 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 / unflatteningOrder.Customer.Name maps to OrderCustomerName and back, by naming convention.
  • Compile-time diagnostics — broken, incomplete, or ambiguous mappings become compiler errors and warnings (SYNTX001SYNTX017) 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

MIT — see LICENSE.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 99 5/22/2026

First release of Synthetix: same-name mapping, flattening/unflattening, collection-element mapping, polymorphic dispatch, existing-instance update, string and primitive conversions, IQueryable projection, async mappers, the SYNTX001-SYNTX024 diagnostics catalog, custom member configuration, and the auditable mapping manifest with drift detection.