Base solution for your next web application
Open Closed

Mapping Error After Upgrading ABP ABPZero #7260


User avatar
0
maharatha created

I recently updated my ASPNET CORE from V6.7 to 7.0 and I am getting ampping error "

AutoMapper.AutoMapperMappingException: Missing type map configuration or unsupported mapping.

I am only getting errors for the screens I created using the RAD Tool. This is happening when I am trying to edit the Entity


3 Answer(s)
  • User Avatar
    0
    maharatha created

    var output = new GetTemplateForEditOutput { Template = ObjectMapper.Map<CreateOrEditTemplateDto>(template) };

    This is where it's errroing

  • User Avatar
    0
    alper created
    Support Team

    The new version of AutoMapper, requires explicitly adding mapping for your DTOs. If the DTO and your entity properties are not equal, you need to ignore those properties

    configuration.CreateMap<Foo, Bar>().ForMember(x => x.MyProperty, opt => opt.Ignore())
    

    Add your custom DTO mappings to CustomDtoMapper

  • User Avatar
    0
    maharatha created

    Thank you I completely removed the Automapper from the custiom code. Didn't make any sense to use it .

    But this should have been marked as a breaking change