A high-performance, developer-friendly object-to-object mapper for .NET that automates mapping code generation.
Mapster is a fast, fun, and stimulating object-to-object mapper for .NET applications. It automates the conversion of data between different object types, such as domain entities and DTOs, eliminating the need for manual mapping code. It solves the problem of repetitive, error-prone boilerplate in data transformation layers.
.NET developers building applications with layered architectures, such as those using Domain-Driven Design (DDD), who need to map between domain models, view models, and API contracts.
Developers choose Mapster for its exceptional performance (up to 12x faster than AutoMapper), built-in code generation for compile-time safety, and unique step-into debugging capability. Its fluent API and seamless DI integration make migration and adoption straightforward.
A fast, fun and stimulating object to object Mapper
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
The README benchmarks show Mapster can be up to 12x faster than AutoMapper and uses only one-third of the memory, making it ideal for data-heavy .NET applications.
With Mapster.Tool, developers automatically generate DTO models and explicit mapper classes at build time, ensuring type safety and enabling raw performance gains.
The diagnostics package allows debugging generated mapping code directly in the IDE, letting developers inspect values like handwritten code—a unique feature among mappers.
Queryable extensions like ProjectToType enable efficient mapping of Entity Framework queries without manual Select expressions, reducing boilerplate and improving query performance.
Mapster implements the IMapper interface, so replacing AutoMapper in dependency injection setups requires minimal code changes, as highlighted in the basic usage section.
Setting up code generation with Mapster.Tool adds extra steps to the build, which can complicate initial configuration and maintenance compared to reflection-based mappers.
While Mapster has plugins for common scenarios, its community and third-party integrations are less extensive than AutoMapper's, potentially limiting support for niche use cases.
Advanced features like fluent configuration for nested mappings or custom transformations require time to master, as the README notes extensive configuration options can be non-trivial.
Mapster is an open-source alternative to the following products: