I use AutoMapper with profiles and it works very well. I recently found the CreateMissingTypeMaps configuration and, if it works, as I understand it, will speed up my development, once when you do not need to create simple mappings.
I added a profile with AddProfile to my configuration and then created a CreateMissingTypeMaps configuration.
Example:
------- Creating a configuration ------------
var config = new MapperConfiguration(cfg => { cfg.AddProfile<PersonServiceMapperProfile>(); cfg.CreateMissingTypeMaps = true; });
------- Inside my PersonServiceMapperProfile ------
internal class PersonServiceMapperProfile : Profile { protected override void Configure() { CreateMap<PersonData, ProfileViewModel>().ConvertUsing<PersonDataToProfileViewModel>(); } }
If the CreateMissingTypeMaps configuration is set to true, the profile no longer works. My user mapping is not called.
How to solve this issue?
source share