DynamicProxyServiceProviderFactory 能否支持ServiceProviderOptions
obpt123 opened this issue · 2 comments
obpt123 commented
大概期望的实现方式是这样的
public class DynamicProxyServiceProviderFactory : IServiceProviderFactory<IServiceCollection>
{
public DynamicProxyServiceProviderFactory()
{
}
public DynamicProxyServiceProviderFactory(bool validateScopes) : this(new ServiceProviderOptions
{ValidateScopes = validateScopes})
{
}
public DynamicProxyServiceProviderFactory(ServiceProviderOptions serviceProviderOptions)
{
ServiceProviderOptions = serviceProviderOptions;
}
public ServiceProviderOptions ServiceProviderOptions { get; }
public IServiceCollection CreateBuilder(IServiceCollection services)
{
return services;
}
public IServiceProvider CreateServiceProvider(IServiceCollection containerBuilder)
{
return ServiceProviderOptions is null
? containerBuilder.BuildDynamicProxyProvider()
: containerBuilder.BuildDynamicProxyProvider(ServiceProviderOptions);
}
}
liuhaoyang commented
可以考虑实现。
liuhaoyang commented
已实现