自动映射有如下几种:

AutoMap,AutoMapFrom AutoMapTo 

 

1.AutoMap在两个方向上映射两个类

下表示Equipment与EquipmentEditDto相互映射

ABP 自动映射 AutoMapper

 

 

2.AutoMapTo映射到后面的类

下表示将 EquipmentEditDto映射到 Equipment

ABP 自动映射 AutoMapper

 

 

3.AutoMapFrom映射到前面的类

下表示Equipment映射到EquipmentEditDto

ABP 自动映射 AutoMapper

 

 

总结:若要表示相互映射可以直接使用AutoMap或者使用如下方式:

ABP 自动映射 AutoMapper

 

 官方文档地址:https://aspnetboilerplate.com/Pages/Documents/Introduction

相关文章:

  • 2021-06-02
  • 2021-09-14
  • 2021-08-19
  • 2022-12-23
  • 2022-02-12
  • 2022-01-04
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-21
  • 2021-07-11
  • 2021-12-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案