Mammoth.LiteMapper.Generator 3.0.0

dotnet add package Mammoth.LiteMapper.Generator --version 3.0.0
                    
NuGet\Install-Package Mammoth.LiteMapper.Generator -Version 3.0.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="Mammoth.LiteMapper.Generator" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Mammoth.LiteMapper.Generator" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Mammoth.LiteMapper.Generator" />
                    
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 Mammoth.LiteMapper.Generator --version 3.0.0
                    
#r "nuget: Mammoth.LiteMapper.Generator, 3.0.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 Mammoth.LiteMapper.Generator@3.0.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=Mammoth.LiteMapper.Generator&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Mammoth.LiteMapper.Generator&version=3.0.0
                    
Install as a Cake Tool

Mammoth.LiteMapper

Mammoth.LiteMapper is a convention-first, compile-time object mapping library for C#.

Consumers declare partial mapping methods on classes marked with [LiteMapper]. A Roslyn incremental source generator emits direct C# implementations using constructors, assignments, loops, casts, and ordinary method calls. LiteMapper is not a runtime mapping container and does not provide runtime mapper registration, assembly scanning, reflection fallback, or dynamic dispatch.

Assembly-wide defaults and external mapper registrations are compile-time inputs. When they change, the incremental generator reevaluates affected generated mappings and diagnostics while preserving unrelated output where Roslyn can preserve its candidate identity.

Generated nested and collection helpers are private implementation details of each generated mapper. Their names are allocated deterministically within that mapper, reserve handwritten and other generated helper signatures, reuse names for identical closed source/destination pairs, and disambiguate distinct pairs without depending on syntax-tree order. Consumers must not depend on generated helper names or signatures.

Compilation Status

  • main CI
  • develop CI

Quickstart

Install the primary package:

<PackageReference Include="Mammoth.LiteMapper" />

Declare a mapper:

using Mammoth.LiteMapper;

[LiteMapper]
public static partial class CustomerMapper
{
    public static partial CustomerDto Map(Customer source);
}

Use the generated method like ordinary C#:

CustomerDto dto = CustomerMapper.Map(customer);

See the compiling samples under samples/ for static mappers, instance mappers, collections, recursive mappings, and ASP.NET Core usage.

Ordinary unmapped target members are reported as LITEMAPPER1001 errors by default. Explicit mapper or method UnmappedMemberPolicy values and standard compiler severity configuration may intentionally relax this configurable diagnostic; doing so preserves valid generation but is not proof of complete target coverage. Required, non-nullable, inaccessible, invalid, and otherwise mandatory target obligations remain hard errors. Projects requiring mandatory unmapped-target coverage should treat LITEMAPPER1001 as an error in CI and audit or avoid project-wide suppression.

Documentation

  • SPECIFICATION.md is the sole authoritative product contract.
  • USAGE.md is the usage guide and must stay synchronized with the specification, samples, tests, and other project documents.

Agent skill

The mammoth-litemapper skill provides consumer mapping guidance for compatible coding agents using the Skills CLI.

Once this skill is published on the repository's default branch, install it from your consuming project:

npx skills add PrimordialCode/Mammoth.LiteMapper --skill mammoth-litemapper

Append --agent codex to target Codex or --global for user-level installation. To preview this checkout's discoverable skills without installing, run npx skills add . --list from the repository root. The skill contains its own supporting reference; consumers do not need a LiteMapper source checkout. Local validation does not establish a skills.sh directory listing.

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
3.0.0 76 9/17/2026
3.0.0-beta.2 44 9/17/2026
3.0.0-beta.1 51 9/17/2026
2.0.0 85 9/10/2026
2.0.0-beta.1 52 9/10/2026
1.0.0 118 6/22/2026
1.0.0-beta.2 83 6/22/2026
1.0.0-beta.1 72 6/19/2026