Base solution for your next web application
Open Closed

AutoMapper.Map in CustomDotMapper #7657


User avatar
0
andmattia created

We refact all code where use AutoMapper.Map with ObjectMapper.Map, so we have some CustomDto, registered via CustomDtoMapper that use AutoMapper.Map or Abp MapTo Extension.

The first option is map all properties one by one but is there a way to use a map to do that?

For example suppose to have Cusotmer & CustomerDto, this is mapped via CustomDto, and you add OrderDataDto with a property Customer type CustomerDto in this context we use cutomerBase.MapTo<CustomerDto>()


2 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    Please do not use static MapTo extension methods, always use ObjectMapper.

    The first option is map all properties one by one but is there a way to use a map to do that?

    It seems that there is no.

    For more information, please refer to the Automapper documentation. Especially the recent breaking change. http://docs.automapper.org/en/stable/index.html https://github.com/AutoMapper/AutoMapper/releases

  • User Avatar
    0
    andmattia created

    Hi maliming

    sorry for the delay.

    Thanks for your response, we move our CustomDto with manual mapping.

    Regards