要获得DI框架以将依赖项注入到Automapper自定义TypeConverter中,通常使用MapperConfiguration对象的ConstructServicesUsing方法。因此,使用ASP.NET核心DI,我希望能够像这样配置AutoMapper:
public static IMapperConfiguration Configure(IServiceProvider据猜测,我认为可能需要给Automapper一个真正的IServiceProvider
它是.NET Core2.0控制台应用程序,使用DI如何将参数传递给构造函数。RabbitMQPersistentConnection(ILogger logger,IConnectionFactory connectionFactory,IEmailService emailService);
Program.cs
public static class