I have created one profile for each destination type. I have configured dependency injection using services.AddAutoMapper(assembly1, assembly2 /*, ...*/); and it is working fine. I wanted to validate that all the properties in the destination type are mapped. we can do this by calling AssertConfigurationIsValid method. The below method is the sample to validate mapping.
var configuration = new MapperConfiguration(cfg =>
cfg.CreateMap<Source, Destination>());
configuration.AssertConfigurationIsValid();
how to validate mapping when using services.AddAutoMapper(assembly1, assembly2 /*, ...*/);
I have created one profile for each destination type. I have configured dependency injection using
services.AddAutoMapper(assembly1, assembly2 /*, ...*/);
and it is working fine. I wanted to validate that all the properties in the destination type are mapped. we can do this by callingAssertConfigurationIsValid
method. The below method is the sample to validate mapping.how to validate mapping when using
services.AddAutoMapper(assembly1, assembly2 /*, ...*/);