【AutoMapper简介】

【简介】git

项目地址:https://github.com/AutoMapper/AutoMappergithub

帮助文档:https://github.com/AutoMapper/AutoMapper/wikiapp

新手入门:https://github.com/AutoMapper/AutoMapper/wiki/Getting-startedide

AutoMapper是一个.NET的对象映射工具,AutoMapper能够将复杂的对象转换为DTO(Data Transfer Object),或者简单的对象,以方便数据的序列化以及传输。工具

【支持的平台】spa

  • .NET 4 and higher
  • Silverlight 4 and higher
  • Windows Phone 7.5 and higher
  • .NET for Windows Store apps (WinRT)

【为何要使用AutoMapper?】code

Mapping code is boring. Testing mapping code is even more boring. AutoMapper provides simple configuration of types, as well as simple testing of mappings. The real question may be "why use object-object mapping?" Mapping can occur in many places in an application, but mostly in the boundaries between layers, such as between the UI/Domain layers, or Service/Domain layers. Concerns of one layer often conflict with concerns in another, so object-object mapping leads to segregated models, where concerns for each layer can affect only types in that layer.对象

层与层之间若是使用同一实体,可能会由于不一样的需求而产生冲突;为了不冲突,能够在各个须要实体的层映射产生须要的实体。文档

相关文章
相关标签/搜索