Exemplo n.º 1
0
 public static void Build(IServiceProvider serviceProvider)
 {
     using var scope = serviceProvider.CreateScope();
     _mapperFactory  = scope.ServiceProvider.GetService(typeof(IMapperFactory)) as IMapperFactory;
     foreach (var mc in _mapperConfigurations)
     {
         var mapperConfig = new MapperConfiguration(mc.Value);
         _mapperFactory.AddMapper(mc.Key, mapperConfig.CreateMapper());
     }
 }