Mapperly is a .NET source generator that creates object mappings at compile time without runtime reflection.
Object mapping between different types is a common task in .NET applications, particularly when working with domain models, DTOs, and API contracts. Mapperly solves this by generating mapping code during compilation using Roslyn, the .NET compiler platform. Rather than relying on runtime reflection to discover and execute mappings, the tool analyzes your code at compile time and produces strongly-typed mapping methods. This approach eliminates the performance overhead of reflection and provides compile-time safety, catching mapping errors before runtime.
Mapperly suits projects where performance matters or where you want mapping logic to be explicit and verifiable. It works well in layered architectures that heavily use DTOs, microservices, and any application where you need predictable, zero-overhead object transformations. If your project already uses reflection-based mappers and you are concerned about startup time or runtime performance, switching to a source generator approach offers measurable benefits. The tool generates human-readable C# code, making it easy to understand exactly what mapping logic is being executed and to debug issues directly in the generated output.
The project maintains a steady cadence of releases with regular updates addressing edge cases and expanding mapping capabilities. Development activity shows consistent engagement with issues and pull requests, indicating active maintenance and responsiveness to user feedback. The codebase demonstrates attention to code quality and test coverage, with comprehensive test suites validating the source generation logic across various mapping scenarios. Documentation is well-maintained through the project website, providing clear guidance on configuration and usage patterns.