awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
riok avatar

riok/mapperly

0
View on GitHub↗
4,100 stars·222 forks·C#·Apache-2.0·17 viewsmapperly.riok.app↗

Mapperly

Mapperly is a C# source generator used for high-performance object-to-object mapping in .NET. It functions as a compile-time mapping library that produces the necessary transformation code during the build process, eliminating the need for runtime reflection when converting between domain models and data transfer objects.

The tool distinguishes itself by providing type-safe diagnostic validation and strict mapping enforcement, emitting warnings for unmapped properties at compile time. It includes specialized capabilities for circular reference handling and deep cloning to maintain object identity and prevent infinite loops during complex transformations.

The project covers a broad range of transformation tasks, including the flattening of nested object hierarchies, the conversion of various collection types and spans, and comprehensive enum mapping between strings and primitive types. It also supports database integration via query projection, translating mapping definitions into expression trees to optimize field retrieval from queryable sources.

Configuration options allow for custom object factories, member-level exclusions, and the integration of user-defined mapping logic. The generated source code can be exported to a configurable directory for manual inspection and version control.

Features

  • Source Generators - Uses C# source generators to produce mapping code during compilation, eliminating runtime reflection.
  • .NET Object Mapping - Provides high-performance object mapping for the .NET ecosystem using source generators to avoid reflection.
  • Data Projections - Maps data from queryable sources to target types to optimize database performance.
  • Query Projections - Translates mapping definitions into database-level query projections to optimize data retrieval.
  • API-to-Domain Mapping - Automates the conversion between internal domain models and data transfer objects for API and database layers.
  • Object-to-Object Mappers - Generates code to transfer data between different .NET object types without manual assignment logic.
  • C# Source Code Generators - Uses C# source generators to automate the production of mapping code during the build process.
  • Compile-Time Field Mapping - Resolves object property assignments at compile time to maximize execution performance by avoiding reflection.
  • Object Type Transformations - Provides automated code generation for transferring data between different .NET object types, interfaces, and generics.
  • Property Strictness - Triggers diagnostic warnings or errors when source or target members remain unmapped to ensure schema integrity.
  • Automatic Object Mappers - Generates conversion logic using direct assignments, casts, and constructors.
  • Compile-Time Mapping Validations - Analyzes mapping signatures at compile time to emit warnings for unmapped properties.
  • Data Transfer Object Mapping - Automates the conversion of data between internal domain models and data transfer objects.
  • Strict Mapping Enforcement - Verifies that every source member is mapped to a target member and reports gaps as compile-time warnings.
  • Property Name Heuristics - Automatically matches source and target properties using naming conventions and case-insensitive analysis.
  • Collection Element Mapping - Maps members and constructor parameters within a loop when converting collections of objects.
  • Complex Data Structure Transformation - Performs complex transformations by flattening nested hierarchies or expanding flat structures.
  • Mapping Validation - Analyzes mapping signatures and member availability at compile time to prevent invalid configurations.
  • Custom Enum Value Assignments - Translates values between enums, strings, and primitive types using custom naming or explicit value strategies.
  • Enum Fallback Management - Provides fallback mechanisms to handle unknown enum values by redirecting them to specified defaults.
  • Nested Attribute Flattening - Converts nested object structures into flat target properties using naming conventions.
  • Null Value Handling - Defines strategies for handling null source values, including assigning them, ignoring them, or throwing exceptions.
  • Object Flattening - Transforms nested object hierarchies into single-level structures or expands flat properties into nested objects.
  • Expression Tree Translation - Translates mapping definitions into expression trees to optimize database retrieval by fetching only required fields.
  • Deep Class Instance Cloning - Creates full independent copies of nested objects and collections to isolate data.
  • Static Mapping Method Generation - Generates mapping logic as static methods to support interface implementations and simplify method resolution.
  • Transformation Method Generation - Produces static methods for object transformations to ensure high performance and simplified discovery.
  • Automated Constructor Analysis - Automates object instantiation by analyzing target constructors and their parameters.
  • Enum Type Conversions - Translates values between enums and strings or different enum types by name or value.
  • Explicit Member Mapping - Manually links specific source enum values to specific target values by overriding automatic discovery.
  • Generic Types - Generates mapping logic for methods with type parameters that satisfy source and target constraints.
  • Collection Format Conversions - Provides conversion between various collection types including Enumerable, Dictionary, Span, Memory, and Queryable.
  • Constructor Parameter Mapping - Links specific source properties to target constructor parameters when names do not match.
  • Constructor Selection Logic - Invokes the most appropriate target constructor based on parameter count or signature preference.
  • Member Matching Strategies - Matches enum entries based on underlying values or exact names with case-insensitive options.
  • Object Initializers - Creates target instances using constructors, custom factories, or by updating existing objects.
  • Enum-to-String Converters - Converts enum values to strings using customizable naming strategies like camelCase or snake_case.
  • Property Exclusion - Prevents specific class properties from being mapped using ignore annotations.
  • Custom Mapping Logic Integration - Supports the integration of custom user-defined methods to handle complex data transformations.
  • Circular Reference Detection - Tracks and reuses object instances during mapping to prevent infinite loops in self-referencing structures.
  • Reference Tracking - Maintains a registry of mapped objects to prevent infinite loops and preserve identity during deep cloning.
  • Mapping Completeness Validations - Validates that all required properties are mapped and flags missing entries during the generation process.
  • In-Place Object Updating - Updates a provided target object instance with source values instead of creating a new instance.
  • Object Property Customizations - Provides capabilities to rename members or ignore specific fields during the object mapping process.
  • Nested Property Extractors - Matches nested source properties to flat target properties by analyzing member name permutations.
  • Property Matching Strategies - Provides configurable property matching, such as case-insensitive name matching, to align source and target members.
  • Strict Enum Mapping Validations - Provides compile-time diagnostics to ensure all enum members are mapped, preventing runtime missing-mapping errors.
  • Core .NET Libraries - Source generator-based mapper for compile-time type-safe transformations.
  • Object Mapping - Source generator for high-performance object mapping without runtime reflection.

Star history

Star history chart for riok/mapperlyStar history chart for riok/mapperly

How this analysis was created: This summary and feature list were written by an AI model that read the project's README and public documentation pages. Each feature links to the documentation it came from; stars, license and language come straight from the GitHub API. The model does not read the source code, and the analysis is refreshed when the project is re-analysed. Learn more on our About page.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Open-source alternatives to Mapperly

Similar open-source projects, ranked by how many features they share with Mapperly.
  • mapstermapper/mapsterMapsterMapper avatar

    MapsterMapper/Mapster

    5,127View on GitHub↗

    Mapster is a .NET object-to-object mapper and high-performance mapping engine used for transforming data between different object models. It functions as a type-safe data transfer tool and a LINQ query projection tool to move data between internal logic and external data structures. The engine utilizes compiled mapping expressions and machine code to reduce overhead during object conversion. It specifically allows for projecting queryable data sources directly into destination types to optimize database retrieval. The toolset covers data transfer object generation, immutable data transformat

    C#
    View on GitHub↗5,127
  • luckypennysoftware/automapperLuckyPennySoftware avatar

    LuckyPennySoftware/AutoMapper

    10,190View on GitHub↗

    AutoMapper is a strongly typed object-to-object mapper for .NET. It provides utilities for copying data between different object representations using convention-based property matching to eliminate manual assignment code. The library automates the transformation of data models by matching source and destination properties based on shared names and types. It supports the conversion of internal domain models into data transfer objects, facilitating data movement between presentation, business, and data access layers. The system employs reflection-based type discovery and recursive object grap

    C#
    View on GitHub↗10,190
  • automapper/automapperAutoMapper avatar

    AutoMapper/AutoMapper

    10,191View on GitHub↗

    AutoMapper is a .NET object-to-object mapper designed to transfer data between different object types. It functions as an automated mapping library that reduces the need for manual property assignments by using naming conventions to match properties between classes. The library focuses on automating data projection and the conversion of internal domain models into data transfer objects. It supports layered architecture decoupling by mapping data between domain entities and view models. The system employs convention-based member matching, flattening-based property projection, and recursive ty

    C#
    View on GitHub↗10,191
  • microsoft/typescript-handbookmicrosoft avatar

    microsoft/TypeScript-Handbook

    4,855View on GitHub↗

    This project is a comprehensive guide and educational resource for the TypeScript language. It covers the fundamental principles of the language, including its structural type system, static type analysis, and the process of transpiling typed source files into JavaScript. The material details how to model complex data and reusable type logic using generics, conditional types, and mapped types. It also explains the use of declaration files to provide type safety for external JavaScript libraries and the integration of type checking into existing JavaScript projects via JSDoc annotations. The

    JavaScriptdocumentationlearntypescript
    View on GitHub↗4,855
See all 30 alternatives to Mapperly→

Frequently asked questions

What does riok/mapperly do?

Mapperly is a C# source generator used for high-performance object-to-object mapping in .NET. It functions as a compile-time mapping library that produces the necessary transformation code during the build process, eliminating the need for runtime reflection when converting between domain models and data transfer objects.

What are the main features of riok/mapperly?

The main features of riok/mapperly are: Source Generators, .NET Object Mapping, Data Projections, Query Projections, API-to-Domain Mapping, Object-to-Object Mappers, C# Source Code Generators, Compile-Time Field Mapping.

What are some open-source alternatives to riok/mapperly?

Open-source alternatives to riok/mapperly include: mapstermapper/mapster — Mapster is a .NET object-to-object mapper and high-performance mapping engine used for transforming data between… automapper/automapper — AutoMapper is a .NET object-to-object mapper designed to transfer data between different object types. It functions as… luckypennysoftware/automapper — AutoMapper is a strongly typed object-to-object mapper for .NET. It provides utilities for copying data between… microsoft/typescript-handbook — This project is a comprehensive guide and educational resource for the TypeScript language. It covers the fundamental… apache/fory — Fory is a cross-language serialization framework and binary data serializer designed to convert complex object graphs… esotericsoftware/kryo — Kryo is a Java binary serialization framework and object cloning library used to convert Java objects into a compact…