The Wayback Machine - https://web.archive.org/web/20211231150632/https://github.com/dotnet/aspnetcore/issues/39251
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Use of IConfigureOptions Consistently Everywhere #39251

Open
RehanSaeed opened this issue Dec 31, 2021 · 0 comments
Open

Allow Use of IConfigureOptions Consistently Everywhere #39251

RehanSaeed opened this issue Dec 31, 2021 · 0 comments

Comments

@RehanSaeed
Copy link
Contributor

@RehanSaeed RehanSaeed commented Dec 31, 2021

Is your feature request related to a problem? Please describe.

IConfigureOptions<T> allows you to move your configuration code to a separate class. However, it cannot be used with certain API's which require us to pass an Action<T>:

IServiceCollection AddStackExchangeRedisCache(this IServiceCollection services, Action<RedisCacheOptions> setupAction)
IServiceCollection AddHsts(this IServiceCollection services, Action<HstsOptions> configureOptions)

This is not an exhaustive list, there may be others.

Describe the solution you'd like

All API's in ASP.NET Core should be consistent and allow us to configure them using IConfigureOptions<T>. The following overloads should be added:

IServiceCollection AddStackExchangeRedisCache(this IServiceCollection services)
IServiceCollection AddHsts(this IServiceCollection services)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant