-
Notifications
You must be signed in to change notification settings - Fork 125
Open
Description
Usually methods that add a registration to DI and have some sorts of configuration options also provide overloads with IServiceProvider accessible, so that user can, for example, pull some config object from DI.
It would be nice to have something like this here as well, especially since IServiceProvider already seems accessible inside the library, but ignored.
Something like this would be helpful:
public static IServiceCollection AddWebOptimizer(this IServiceCollection services, Action<IAssetPipeline> assetPipeline, Func<IServiceProvider, WebOptimizerOptions> configureWebOptimizer)
{
return services.RegisterComponents(assetPipeline,
ServiceDescriptor.Singleton<IConfigureOptions<WebOptimizerOptions>, InCodeWebOptimizerConfig>(sp =>
new InCodeWebOptimizerConfig(configureWebOptimizer(sp))));
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels