Base solution for your next web application
Open Closed

Custom Dto Mapping #10333


User avatar
0
jdavis01 created

I am running Version 10.3.0 MVC .Net Core. Instead of having one large CustomDtoMapping class with all mapping placed inside of it, I would like to create individual custom mapping classes for each entity and place it inside the applicationservice folder for better management. It would also help with upgrades since all my code would be in a specific folder

What are the best practices / requirements to make this happen?


1 Answer(s)
  • User Avatar
    0
    musa.demir created

    Hi @jdavis01

    Here is where we add configurators by default. https://github.com/aspnetzero/aspnet-zero-core/blob/020125e04bf54bb433b67f64c07e33fc35fbe23b/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Application/AbpZeroTemplateApplicationModule.cs#L23

    Configuration.Modules.AbpAutoMapper().Configurators.Add(CustomDtoMapper.CreateMappings);
    

    You can create any number of DtoMapper and add them to Configuration.Modules.AbpAutoMapper().Configurators