Skip to content

Commit

Permalink
修改文档
Browse files Browse the repository at this point in the history
  • Loading branch information
yihango committed Jun 13, 2021
1 parent f9fdac2 commit d50a6c2
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 77 deletions.
12 changes: 6 additions & 6 deletions cn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

##### 配置
* [映射配置](Configuration.md)
* [配置继承](Config-inheritance.md)
* [配置实例](Config-instance.md)
* [配置位置](Config-location.md)
* [配置验证和编译](Config-validation-&-compilation.md)
* [配置嵌套映射](Config-for-nested-mapping.md)
* [映射配置继承](Config-inheritance.md)
* [映射配置实例](Config-instance.md)
* [映射配置位置](Config-location.md)
* [映射配置验证和编译](Config-validation-&-compilation.md)
* [映射配置嵌套映射](Config-for-nested-mapping.md)

##### 设置
* 自定义成员映射
Expand Down Expand Up @@ -41,7 +41,7 @@
* [Immutable映射支持](Immutable.md)
* [Json.net](Json.net.md)

##### Tools
##### 工具
* [Mapster.Tool](Mapster.Tool.md)
* [Fluent API](Fluent-API-Code-generation.md)
* [Attributes](Attribute-base-Code-generation.md)
Expand Down
142 changes: 71 additions & 71 deletions cn/References.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,112 +19,112 @@
#### Builder (用于复杂映射)
| 方法 | 说明 | 链接 |
| ------------- |-----------------------| ----- |
| `src.BuildAdapter()` <br> `mapper.From(src)` | 创建 builder | [mappers](https://github.com/MapsterMapper/Mapster/wiki/Mappers) |
| `.ForkConfig(config => ...)` | 内连配置 | [config location](https://github.com/MapsterMapper/Mapster/wiki/Config-location) |
| `.AddParameters(name, value)` | Passing runtime value | [setting values](https://github.com/MapsterMapper/Mapster/wiki/Setting-values) |
| `src.BuildAdapter()` <br> `mapper.From(src)` | 创建 builder | [映射器](Mappers.md) |
| `.ForkConfig(config => ...)` | 内联配置 | [映射配置位置](Config-location.md) |
| `.AddParameters(name, value)` | 传递动态值 | [设置值](Setting-values.md) |
| `.AdaptToType<Dest>()` | 映射到新类型 | |
| `.AdaptTo(dest)` | 映射到现有对象 | |
| `.CreateMapExpression<Dest>()` | 获取映射表达式树对象 | |
| `.CreateMapToTargetExpression<Dest>()` | 获取映射到现有对象的表达式树对象 | |
| `.CreateProjectionExpression<Dest>()` | 获取映射 IQueryable 的表达式树对象 | |

#### Config
#### 配置
| 方法 | 说明 | 链接 |
| ------------- |-----------------------| ----- |
| `TypeAdapterConfig.GlobalSettings` | 全局配置 | [config](https://github.com/MapsterMapper/Mapster/wiki/Configuration) |
| `var config = new TypeAdapterConfig()` | 创建新的配置实例 | [config instance](https://github.com/MapsterMapper/Mapster/wiki/Config-instance) |
| `TypeAdapterConfig.GlobalSettings` | 全局配置 | [映射配置](Configuration.md) |
| `var config = new TypeAdapterConfig()` | 创建新的配置实例 | [映射配置实例](Config-instance.md) |
| `src.Adapt<Dest>(config)` | 映射到新类型并指定配置 | |
| `new Mapper(config)` | 指定映射器的配置 | |
| `src.BuildAdapter(config)` | 指定Builder的配置 | |
| `config.RequireDestinationMemberSource` | 验证所有属性的映射 | [config validation](https://github.com/MapsterMapper/Mapster/wiki/Config-validation-&-compilation) |
| `config.RequireExplicitMapping` | Validate all type pairs are defined | [config validation](https://github.com/MapsterMapper/Mapster/wiki/Config-validation-&-compilation) |
| `config.AllowImplicitDestinationInheritance` | 使用基于 **目标类** 的配置 | [inheritance](https://github.com/MapsterMapper/Mapster/wiki/Config-inheritance) |
| `config.AllowImplicitSourceInheritance` | 使用基于 **源类** 的配置 | [inheritance](https://github.com/MapsterMapper/Mapster/wiki/Config-inheritance) |
| `config.SelfContainedCodeGeneration` |**1** 个方法中生成所有嵌套映射 | [TextTemplate](https://github.com/MapsterMapper/Mapster/wiki/TextTemplate) |
| `config.Compile()` | 验证映射配置并缓存映射 | [config validation](https://github.com/MapsterMapper/Mapster/wiki/Config-validation-&-compilation) |
| `config.RequireDestinationMemberSource` | 验证所有属性的映射 | [映射配置验证](Config-validation-&-compilation.md) |
| `config.RequireExplicitMapping` | 是否开启强制显示映射配置 | [映射配置验证](Config-validation-&-compilation.md) |
| `config.AllowImplicitDestinationInheritance` | 使用基于 **目标类** 的配置 | [映射配置继承](Config-inheritance.md) |
| `config.AllowImplicitSourceInheritance` | 使用基于 **源类** 的配置 | [映射配置继承](Config-inheritance.md) |
| `config.SelfContainedCodeGeneration` |**1** 个方法中生成所有嵌套映射 | [TextTemplate](TextTemplate.md) |
| `config.Compile()` | 验证映射配置并缓存映射 | [映射配置验证](Config-validation-&-compilation.md) |
| `config.CompileProjection()` | 验证 IQueryable 映射配置并缓存映射 | |
| `config.Clone()` | 复制配置 | [config instance](https://github.com/MapsterMapper/Mapster/wiki/Config-instance) |
| `config.Fork(forked => ...)` | 内联配置 | [config location](https://github.com/MapsterMapper/Mapster/wiki/Config-location) |
| `config.Clone()` | 复制配置 | [映射配置位置](Config-instance.md) |
| `config.Fork(forked => ...)` | 内联配置 | [映射配置位置](Config-location.md) |

#### 扫描配置

| 方法 | 说明 | 链接 |
| ------------- |-----------------------| ----- |
| `IRegister` | 映射配置扫描接口 | [config location](https://github.com/MapsterMapper/Mapster/wiki/Config-location) |
| `config.Scan(...assemblies)` | 扫描程序集中的映射配置 | [config location](https://github.com/MapsterMapper/Mapster/wiki/Config-location) |
| `config.Apply(...registers)` | 应用 映射配置 | [config location](https://github.com/MapsterMapper/Mapster/wiki/Config-location) |
| `IRegister` | 映射配置扫描接口 | [映射配置位置](Config-location.md) |
| `config.Scan(...assemblies)` | 扫描程序集中的映射配置 | [映射配置位置](Config-location.md) |
| `config.Apply(...registers)` | 应用 映射配置 | [映射配置位置](Config-location.md) |

#### Declare settings
#### 定义映射配置

| 方法 | 说明 | 链接 |
| ------------- |-----------------------| ----- |
| `config.Default` | 配置应用于所有类型映射 | [config](https://github.com/MapsterMapper/Mapster/wiki/Configuration) |
| `TypeAdapterConfig<Src, Dest>.NewConfig()` <br> `config.NewConfig<Src, Dest>()` | 创建应用于特定类型映射的配置 | [config](https://github.com/MapsterMapper/Mapster/wiki/Configuration) |
| `TypeAdapterConfig<Src, Dest>.ForType()` <br> `config.ForType<Src, Dest>()` | 配置应用于特定类型映射 | [config](https://github.com/MapsterMapper/Mapster/wiki/Configuration) |
| `config.ForType(typeof(GenericPoco<>),typeof(GenericDto<>))` | 配置应用于泛型类型映射 | [config](https://github.com/MapsterMapper/Mapster/wiki/Configuration) |
| `config.When((src, dest, mapType) => ...)` | 配置根据条件进行的类型映射 | [config](https://github.com/MapsterMapper/Mapster/wiki/Configuration) |
| `config.ForDestinationType<Dest>()` | 配置应用于特定目标类型 | [config](https://github.com/MapsterMapper/Mapster/wiki/Configuration) |
| | Configuration for nested mapping | [nested mapping](https://github.com/MapsterMapper/Mapster/wiki/Config-for-nested-mapping)

#### Settings
| `config.Default` | 配置应用于所有类型映射 | [映射配置](Configuration.md) |
| `TypeAdapterConfig<Src, Dest>.NewConfig()` <br> `config.NewConfig<Src, Dest>()` | 创建应用于特定类型映射的配置 | [映射配置](Configuration.md) |
| `TypeAdapterConfig<Src, Dest>.ForType()` <br> `config.ForType<Src, Dest>()` | 配置应用于特定类型映射 | [映射配置](Configuration.md) |
| `config.ForType(typeof(GenericPoco<>),typeof(GenericDto<>))` | 配置应用于泛型类型映射 | [映射配置](Configuration.md) |
| `config.When((src, dest, mapType) => ...)` | 配置根据条件进行的类型映射 | [映射配置](Configuration.md) |
| `config.ForDestinationType<Dest>()` | 配置应用于特定目标类型 | [映射配置](Configuration.md) |
| | 嵌套映射的配置 | [嵌套映射](Config-for-nested-mapping.md) |

#### 配置
| 方法 | 说明 | 支持 IQueryable | 链接 |
| ------------- |-----------------------| ------------ | ----- |
| `AddDestinationTransform` | 清除特定类型的数据 | x | [setting values](https://github.com/MapsterMapper/Mapster/wiki/Setting-values) |
| `BeforeMapping` | 在映射开始之前的步骤 | | [before-after](https://github.com/MapsterMapper/Mapster/wiki/Before-after-mapping) |
| `AfterMapping` | 映射完成之后的步骤 | | [before-after](https://github.com/MapsterMapper/Mapster/wiki/Before-after-mapping) |
| `AvoidInlineMapping` | 对于大型类型映射,跳过内联处理 | | [object reference](https://github.com/MapsterMapper/Mapster/wiki/Object-references) |
| `ConstructUsing` | 定义如何创建对象 | x | [constructor](https://github.com/MapsterMapper/Mapster/wiki/Constructor-mapping) |
| `EnableNonPublicMembers` | 非公开的属性映射 | | [non-public](https://github.com/MapsterMapper/Mapster/wiki/Mapping-non-public-members) |
| `EnumMappingStrategy` | 选择按值还是按名称映射枚举 | | [data types](https://github.com/MapsterMapper/Mapster/wiki/Data-types) |
| `Fork` | 在主配置上添加没有副作用的新配置 | x | [nested mapping](https://github.com/MapsterMapper/Mapster/wiki/Config-for-nested-mapping) |
| `GetMemberName` | 定义如何解析属性名 | x | [custom naming](https://github.com/MapsterMapper/Mapster/wiki/Naming-convention) |
| `Ignore` | 忽略特定属性 | x | [ignore](https://github.com/MapsterMapper/Mapster/wiki/Ignoring-members) |
| `IgnoreAttribute` | 忽略属性上特定的特性标记 | x | [attribute](https://github.com/MapsterMapper/Mapster/wiki/Setting-by-attributes) |
| `IgnoreIf` | 忽略表达式 | x | [ignore](https://github.com/MapsterMapper/Mapster/wiki/Ignoring-members) |
| `IgnoreMember` | 忽略设置规则 | x | [rule based](https://github.com/MapsterMapper/Mapster/wiki/Rule-based-member-mapping) |
| `IgnoreNonMapped` | 忽略 `Map` 中未定义的所有属性 | x | [ignore](https://github.com/MapsterMapper/Mapster/wiki/Ignoring-members) |
| `IgnoreNullValues` | 如果 源属性 为空,则不映射 | | [shallow & merge](https://github.com/MapsterMapper/Mapster/wiki/Shallow-merge) |
| `Include` | 映射包含派生类型 | | [inheritance](https://github.com/MapsterMapper/Mapster/wiki/Config-inheritance) |
| `IncludeAttribute` | 包括在属性上注释的特定的特性标记 | x | [attribute](https://github.com/MapsterMapper/Mapster/wiki/Setting-by-attributes) |
| `IncludeMember` | 包含的配置规则 | x | [rule based](https://github.com/MapsterMapper/Mapster/wiki/Rule-based-member-mapping) |
| `Inherits` | Copy setting from based type | x | [inheritance](https://github.com/MapsterMapper/Mapster/wiki/Config-inheritance) |
| `Map` | Define property pairs | x | [custom mapping](https://github.com/MapsterMapper/Mapster/wiki/Custom-mapping) |
| `MapToConstructor` | Mapping to constructor | x | [constructor](https://github.com/MapsterMapper/Mapster/wiki/Constructor-mapping) |
| `MapToTargetWith` | Define how to map to existing object between type pair | | [custom conversion](https://github.com/MapsterMapper/Mapster/wiki/Custom-conversion-logic) |
| `MapWith` | Define how to map between type pair | x | [custom conversion](https://github.com/MapsterMapper/Mapster/wiki/Custom-conversion-logic) |
| `MaxDepth` | Limit depth of nested mapping | x | [object reference](https://github.com/MapsterMapper/Mapster/wiki/Object-references) |
| `NameMatchingStrategy` | Define how to resolve property's name | x | [custom naming](https://github.com/MapsterMapper/Mapster/wiki/Naming-convention) |
| `PreserveReference` | Tracking reference when mapping | | [object reference](https://github.com/MapsterMapper/Mapster/wiki/Object-references) |
| `ShallowCopyForSameType` | Direct assign rather than deep clone if type pairs are the same | | [shallow & merge](https://github.com/MapsterMapper/Mapster/wiki/Shallow-merge) |
| `TwoWays` | Define type mapping are 2 ways | x | [2-ways & unflattening](https://github.com/MapsterMapper/Mapster/wiki/Two-ways) |
| `Unflattening` | Allow unflatten mapping | x |[2-ways & unflattening](https://github.com/MapsterMapper/Mapster/wiki/Two-ways) |
| `UseDestinationValue` | Use existing property object to map data | |[readonly-prop](https://github.com/MapsterMapper/Mapster/wiki/Mapping-readonly-prop) |
| `AddDestinationTransform` | 清除特定类型的数据 | x | [设置值](Setting-values.md) |
| `BeforeMapping` | 在映射开始之前的步骤 | | [映射前&映射后](Before-after-mapping.md) |
| `AfterMapping` | 映射完成之后的步骤 | | [映射前&映射后](Before-after-mapping.md) |
| `AvoidInlineMapping` | 对于大型类型映射,跳过内联处理 | | [对象引用](Object-references.md) |
| `ConstructUsing` | 定义如何创建对象 | x | [构造函数](Constructor-mapping.md) |
| `EnableNonPublicMembers` | 映射非公开成员 | | [映射非公开成员](Mapping-non-public-members.md) |
| `EnumMappingStrategy` | 选择按值还是按名称映射枚举 | | [数据类型](Data-types.md) |
| `Fork` | 在主配置上添加没有副作用的新配置 | x | [嵌套映射](Config-for-nested-mapping.md) |
| `GetMemberName` | 定义如何解析成员名 | x | [自定义成员名称](Naming-convention.md) |
| `Ignore` | 忽略特定属性 | x | [映射忽略](Ignoring-members.md) |
| `IgnoreAttribute` | 忽略属性上特定的特性标记 | x | [特性标记](Setting-by-attributes.md) |
| `IgnoreIf` | 忽略表达式 | x | [根据条件映射忽略](Ignoring-members.md) |
| `IgnoreMember` | 忽略设置规则 | x | [基于规则](Rule-based-member-mapping.md) |
| `IgnoreNonMapped` | 忽略 `Map` 中未定义的所有属性 | x | [映射忽略](Ignoring-members.md) |
| `IgnoreNullValues` | 如果 源属性 为空,则不映射 | | [浅映射和合并映射](Shallow-merge.md) |
| `Include` | 映射包含派生类型 | | [映射配置继承](Config-inheritance.md) |
| `IncludeAttribute` | 包括在属性上注释的特定的特性标记 | x | [特性标记](Setting-by-attributes.md) |
| `IncludeMember` | 包含的配置规则 | x | [基于规则](Rule-based-member-mapping.md) |
| `Inherits` | 复制基类的映射配置 | x | [映射配置继承](Config-inheritance.md) |
| `Map` | 定义属性映射 | x | [自定义映射](Custom-mapping.md) |
| `MapToConstructor` | 构造函数映射 | x | [构造函数](Constructor-mapping.md) |
| `MapToTargetWith` | 定义如何映射到现有对象 | | [自定义映射](Custom-conversion-logic.md) |
| `MapWith` | 定义如何映射 | x | [自定义映射](Custom-conversion-logic.md) |
| `MaxDepth` | 定义映射最大深度 | x | [对象引用](Object-references.md) |
| `NameMatchingStrategy` | 定义如何解析属性的名称 | x | [自定义成员名称](Naming-convention.md) |
| `PreserveReference` | 映射时追踪引用 | | [对象引用](Object-references.md) |
| `ShallowCopyForSameType` | 如果源类型与目标类型相同,直接分配而不是深度克隆 | | [浅映射和合并映射](Shallow-merge.md) |
| `TwoWays` | 定义双向映射 | x | [双向 & 逆扁平映射](Two-ways.md) |
| `Unflattening` | 逆扁平映射 | x |[双向 & 逆扁平映射](Two-ways.md) |
| `UseDestinationValue` | 使用现有属性对象映射数据 | |[映射只读属性](Mapping-readonly-prop.md) |

#### Attributes

| 特性 | 说明 | 链接 |
| ------------- |-----------------------| ----- |
| `[AdaptMember(name)]` | Mapping property to different name | [attribute](https://github.com/MapsterMapper/Mapster/wiki/Setting-by-attributes) |
| `[AdaptIgnore(side)]` | Ignore property from mapping | [attribute](https://github.com/MapsterMapper/Mapster/wiki/Setting-by-attributes) |
| `[UseDestinationValue]` | Use existing property object to map data | [attribute](https://github.com/MapsterMapper/Mapster/wiki/Setting-by-attributes) |
| `[AdaptTo]` `[AdaptFrom]` `[AdaptTwoWays]` | Add setting on POCO class | [location](https://github.com/MapsterMapper/Mapster/wiki/Config-location#attributes) |
| `[Mapper]` `[GeneratMapper]` `[PropertyType]` | Define setting for code generation | [Mapster.Tool](https://github.com/MapsterMapper/Mapster/wiki/Mapster.Tool) |
| `[AdaptMember(name)]` | 设置属性映射的目标的属性名称 | [基于Attribute的配置](Setting-by-attributes.md) |
| `[AdaptIgnore(side)]` | 映射时忽略成员 | [基于Attribute的配置](Setting-by-attributes.md) |
| `[UseDestinationValue]` | 使用现有属性对象映射数据 | [基于Attribute的配置](Setting-by-attributes.md) |
| `[AdaptTo]` `[AdaptFrom]` `[AdaptTwoWays]` | 在POCO类上添加设置 | [映射配置位置](Config-location.md#attributes) |
| `[Mapper]` `[GeneratMapper]` `[PropertyType]` | 为代码生成定义设置 | [Mapster.Tool](Mapster.Tool.md) |

#### 插件库

| 名称 | 方法 | 说明 |
| ------ | ------------- |-----------------------|
| [Async](https://github.com/MapsterMapper/Mapster/wiki/Async) | `setting.AfterMappingAsync` <br> `builder.AdaptToTypeAsync` | perform async operation on mapping |
| [Debugging](https://github.com/MapsterMapper/Mapster/wiki/Debugging) | `config.Compiler = exp => exp.CompileWithDebugInfo()` | compile to allow step into debugging |
| [Dependency Injection](https://github.com/MapsterMapper/Mapster/wiki/Dependency-Injection) | `MapContext.Current.GetService<IService>()` | Inject service into mapping logic |
| [EF 6 & EF Core](https://github.com/MapsterMapper/Mapster/wiki/EF-6-&-EF-Core) | `builder.EntityFromContext` | Copy data to tracked EF entity |
| [FEC](https://github.com/MapsterMapper/Mapster/wiki/FastExpressionCompiler) | `config.Compiler = exp => exp.CompileFast()` | compile using FastExpressionCompiler |
| [Immutable](https://github.com/MapsterMapper/Mapster/wiki/Immutable) | `config.EnableImmutableMapping()` | mapping to immutable collection |
| [Json.net](https://github.com/MapsterMapper/Mapster/wiki/Json.net) | `config.EnableJsonMapping()` | map json from/to poco and string |
| [Async](Async.md) | `setting.AfterMappingAsync` <br> `builder.AdaptToTypeAsync` | 对映射执行异步操作 |
| [Debugging](Debugging.md) | `config.Compiler = exp => exp.CompileWithDebugInfo()` | 编译以允许步进调试 |
| [Dependency Injection](Dependency-Injection.md) | `MapContext.Current.GetService<IService>()` | 依赖注入获取映射服务 |
| [EF 6 & EF Core](EF-6-&-EF-Core.md) | `builder.EntityFromContext` | 将数据复制到跟踪的EF实体 |
| [FEC](FastExpressionCompiler.md) | `config.Compiler = exp => exp.CompileFast()` | 编译使用FastExpressionCompiler |
| [Immutable](Immutable.md) | `config.EnableImmutableMapping()` | 映射到 immutable collection(只读集合.md) |
| [Json.net](Json.net.md) | `config.EnableJsonMapping()` | 映射JSON对象到实体类或字符串;映射实体类或字符串到 JSON 对象 |

#### 代码生成器

| 插件 | 工具 | 说明 |
| ------ | ------------- |-----------------------|
| [Mapster.Tool](https://github.com/MapsterMapper/Mapster/wiki/Mapster.Tool) | `dotnet mapster` | 生成 DTO 并在构建时映射代码 |
| [TextTemplate](https://github.com/MapsterMapper/Mapster/wiki/TextTemplate) | `t4` | 使用 T4 生成映射代码 |
| [Mapster.Tool](Mapster.Tool.md) | `dotnet mapster` | 生成 DTO 并在构建时映射代码 |
| [TextTemplate](TextTemplate.md) | `t4` | 使用 T4 生成映射代码 |

0 comments on commit d50a6c2

Please sign in to comment.