# riok/mapperly

A .NET source generator for generating object mappings. No runtime reflection.

Repository: https://github.com/riok/mapperly
Canonical: https://ross.abutalabs.com/products/mapperly
Homepage: https://mapperly.riok.app
Language: C#
License: Apache-2.0
License Family: permissive
Topics: csharp-sourcegenerator, mapping, csharp, roslyn, dotnet, dotnet-core, c-sharp
Last push: 2026-08-17T18:49:13+00:00

## Health v2 (maintenance only)
Score: 82/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 98, release rhythm 50, longevity 100
- inputs: {"age_days": 1661, "days_push": 16, "days_rel": 254, "gap_med": 44.0, "n_releases_24m": 7}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4153, forks 227 (observed 2026-08-28T04:08:36.501092+00:00)

## What it is
Mapperly is a .NET source generator that automatically implements object-to-object mapping methods declared as partial methods, generating readable mapping code at build time. It uses no runtime reflection, making generated mappings fast, trimming-safe, and AOT-friendly.

## Use cases
- generate object mapping code in .NET without runtime reflection
- map entities to DTOs in a layered application
- replace hand-written boilerplate mapping code in C#
- get compile-time warnings for unmapped properties
- create AOT and trimming-safe mappers for .NET
- map between enums and nested objects automatically
- project queryable objects for optimized ORM queries

## When to choose
- you want fast, readable, debuggable mapping code generated at build time
- your app uses trimming or Native AOT and reflection-based mappers fail
- you want compile-time diagnostics for unmapped or ignored members
- you want zero runtime dependencies for mapping

## When to avoid
- you need runtime-configurable or dynamic mappings decided at execution time
- you're not on .NET 5+ / C# 9+ with Roslyn 4.0+
- you prefer convention-based runtime mappers like AutoMapper with runtime configuration

## Facets
- artifact type: library
- maturity: active
- function: serialization, build-tool, developer-tools
- domain: developer-tools, backend, web-development, apis
- platform: dotnet, cross-platform
- tags: source-generator, roslyn, object-mapping, dto-mapping, aot-friendly, trimming-safe, csharp, no-reflection

## Member repositories
- riok/mapperly (main) score 82

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:36.501092+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:22:53.385467+00:00, confidence not recorded.
  - readme: https://github.com/riok/mapperly (fetched 2026-08-28T04:08:36.501092+00:00, sha 99c71ed75b37)
  - homepage: https://mapperly.riok.app (fetched 2026-08-29T09:13:48.519851+00:00, sha a57450083bfa)
  - site_page: https://mapperly.riok.app/docs/intro (fetched 2026-08-29T09:13:48.529067+00:00, sha 5aebe45d0367)
  - site_page: https://mapperly.riok.app/docs/category/api (fetched 2026-08-29T09:13:48.531282+00:00, sha 08409167e209)
  - site_page: https://mapperly.riok.app/docs/contributing (fetched 2026-08-29T09:13:48.533136+00:00, sha da19bc1fbff8)
  - site_page: https://mapperly.riok.app/docs/getting-started/installation (fetched 2026-08-29T09:13:48.534962+00:00, sha 6af426f45b25)
  - site_page: https://mapperly.riok.app/docs/category/usage-and-configuration (fetched 2026-08-29T09:13:48.536507+00:00, sha 01c30e2c264c)
- Data as of 2026-08-30T08:39:29.467469+00:00.
