登录 注册
其他
10,180
Stars
2,394
Forks
366
Watchers
8
Open Issues
NOASSERTION
许可证
C#
语言
2010-02-06
创建时间
2026-11-06
最近更新

项目能做什么

基于约定的 .NET 对象间映射(Object-Object Mapper)工具。
来源:AI 基于仓库事实生成 · 内容以仓库实际 README 为准

使用说明 查看原始 README 原仓库文档

中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
![AutoMapper](https://s3.amazonaws.com/automapper/logo.png)

[![CI](https://github.com/luckypennysoftware/automapper/workflows/CI/badge.svg)](https://github.com/luckypennysoftware/AutoMapper/actions?query=workflow%3ACI)
[![NuGet](http://img.shields.io/nuget/vpre/AutoMapper.svg?label=NuGet)](https://www.nuget.org/packages/AutoMapper/)
[![Documentation Status](https://readthedocs.org/projects/automapper/badge/?version=stable)](https://docs.automapper.io/en/stable/?badge=stable)


### What is AutoMapper?

AutoMapper is a simple little library built to solve a deceptively complex problem - getting rid of code that mapped one object to another. This type of code is rather dreary and boring to write, so why not invent a tool to do it for us?

This is the main repository for AutoMapper, but there's more:

* [Collection Extensions](https://github.com/AutoMapper/AutoMapper.Collection)
* [Expression Mapping](https://github.com/AutoMapper/AutoMapper.Extensions.ExpressionMapping)
* [EF6 Extensions](https://github.com/AutoMapper/AutoMapper.EF6)
* [IDataReader/Record Extensions](https://github.com/AutoMapper/AutoMapper.Data)
* [Enum Extensions](https://github.com/AutoMapper/AutoMapper.Extensions.EnumMapping)

### How do I get started?

First, configure AutoMapper to know what types you want to map, in the startup of your application:

```csharp
var configuration = new MapperConfiguration(cfg => 
{
    cfg.CreateMap<Foo, FooDto>();
    cfg.CreateMap<Bar, BarDto>();
}, loggerFactory);

// or more typically, using IServiceCollection with automatic service registration
services.AddAutoMapper(cfg => 
{
    cfg.CreateMap<Foo, FooDto>();
    cfg.CreateMap<Bar, BarDto>();
});
// AutoMapper will automatically register any implementations of:
// - IValueResolver<TSource, TDestination, TDestMember>
// - IMemberValueResolver<TSource, TDestination, TSourceMember, TDestMember>
// - ITypeConverter<TSource, TDestination>
// - IValueConverter<TSourceMember, TDestinationMember>
// - ICondition<TSource, TDestination, TDestMember>
// - IPreCondition<TSource, TDestination>
// - IMappingAction<TSource, TDestination>
// from the provided assemblies

// only during development, validate your mappings; remove it before release
#if DEBUG
configuration.AssertConfigurationIsValid();
#endif
// use DI (http://docs.automapper.io/en/latest/Dependency-injection.html) or create the mapper yourself
var mapper = configuration.CreateMapper();
```
Then in your application code, execute the mappings:

```csharp
var fooDto = mapper.Map<FooDto>(foo);
var barDto = mapper.Map<BarDto>(bar);
```

Check out the [getting started guide](https://automapper.readthedocs.io/en/latest/Getting-started.html). When you're done there, the [wiki](https://automapper.readthedocs.io/en/latest/) goes in to the nitty-gritty details. If you have questions, you can post them to [Stack Overflow](https://stackoverflow.com/questions/tagged/automapper).

### Where can I get it?

First, [install NuGet](http://docs.nuget.org/docs
阅读完整原文

项目深度分析 AI 生成

官方商业许可与企业级技术支持 (已有模式扩展)

产品构想基于项目已引入的商业 License 机制(AutoMapper 16.2.0+),向企业提供官方商业使用授权及优先支持响应服务。
核心功能商业授权 License Key(解除开源协议法律风险或合规限制)、专用企业技术支持工单通道、漏洞与兼容性优先修复。
目标用户有法务合规要求、依赖关键业务系统稳定性的中大型企业 .NET 研发团队。
难度/周期低 · 1-2周 · 成本:极低(主要是客户支持与许可证签发运维成本)
收费模式按组织/开发者席位收取年费订阅(如每年几百至数千美元)。
竞争风险若开源社区对商业化授权变更产生抵触情绪,可能导致部分用户流失至替代品(如 Mapperly 等 Source Generator 类库)。
依据 已验证事实

高级映射性能监控与可视化调试工具 (DevTools)

产品构想开发针对 AutoMapper 的可视化调试与性能剖析扩展插件(Visual Studio / JetBrains Rider 插件或独立 WebUI),解决大型项目映射排错难、启动慢的问题。
核心功能Mapping 规则可视化追踪、启动期配置瓶颈诊断、隐式类型转换警告与性能劣化检测、运行时映射执行链路分析。
目标用户.NET 高级架构师、大型企业微服务或单体架构维护团队。
难度/周期中等 · 2-3个月 · 成本:开发调试工具与 IDE 插件的工时投入
收费模式付费 IDE 插件订阅,或作为 Enterprise License 的专属功能套件打包销售。
竞争风险目标用户可能习惯自行打印日志或利用单元测试验证,独立购买工具的转化率不确定。
依据 AI推测

代码静态分析与自动化迁移套件 (编译期增强/迁移工具)

产品构想提供 Roslyn 分析器套件,用于在编译期发现无效/低效的映射配置,并提供从旧版本反射映射向现代 Source Generator 或高效模式自动重构的升级工具。
核心功能Roslyn 实时代码分析与代码修复(Code Fixes)、配置失效静态检查(无需等待运行时 AssertConfigurationIsValid)、自动化重构迁移脚本。
目标用户需要升级维护遗留系统、追求极致 API 吞吐量的技术团队。
难度/周期中等 · 1-2个月 · 成本:主要为掌握 Roslyn API 的研发人力投入
收费模式向企业售卖专有分析器 NuGet 包,或提供付费迁移咨询支持服务。
竞争风险新一代竞品原生支持编译期生成,可能直接绕开运行时配置的需求。
依据 尚需验证的假设
AI 基于仓库公开数据分析生成,含推测成分,不构成收益承诺。
报告会保存到 个人中心

竞品与相似项目 GitHub Search 真实检索

相似项目数据正在完善中,暂不展示(避免误导)

项目优势与风险

技术成熟度创建于 2010-02-06,近 30 天仍在推送,发布过 57 个 Release
社区活跃Star 10,180 / Fork 2,394 / Issue 8(数据支持,可自行核实)
许可证NOASSERTION
主要风险上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价

安装与使用

此项目未提供 Docker 镜像,安装步骤以原仓库 README 为准(涉及依赖安装与环境配置,对新手门槛较高)。