On the section "Using another Dependency Injection framework" it states that you can use
RuntimeConfiguration.SetDependencyInjectionInfo(services, [...])
inside the method
public void ConfigureServices(IServiceCollection services)
However, SetDependencyInjectionInfo
takes an IServiceProvider type and not the IServiceCollection
type.
I had better luck with putting the call to "SetDependencyInjectionInfo" here:
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
RuntimeConfiguration.SetDependencyInjectionInfo(app.ApplicationServices,
(s, e)=>e.AuditorToUse=(IAuditor)s.GetService(typeof(IAuditor)),
(s, e) => e.AuthorizerToUse=(IAuthorizer)s.GetService(
typeof(IMyAuthorizer<>).MakeGenericType(e.GetType())));
}