Skip to content
This repository has been archived by the owner on Nov 7, 2018. It is now read-only.

Add Configure<TOptions, TService1...5>(Action<TOptions>, TService1...5) overloads #236

Closed
HaoK opened this issue Sep 29, 2017 · 1 comment
Assignees
Milestone

Comments

@HaoK
Copy link
Member

HaoK commented Sep 29, 2017

See discussion here: aspnet/StaticFiles#184 (comment)

Basic jist is to add sugar for a transient configure options that takes dependencies.

We would have to do this for named + postConfigure variants as well.

services.Configure<TOptions, TDependency>(Action<TOptions> configure)

which would register as transient something like:

class ConfigureOptions<TOptions, TDependency> : IConfigureOptions<TOptions> {
    ConfigureWithDI(TDependency dep) => Dep = dep;
    TDependency Dep { get; }
}
@HaoK
Copy link
Member Author

HaoK commented Nov 21, 2017

edc21af

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant