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

Add ServiceProvider aware overloads to Configure #219

Closed
wants to merge 1 commit into from

Conversation

fredrikhr
Copy link

@fredrikhr fredrikhr commented Jul 19, 2017

Provides overloads to the Configure methods that do not require an actual IConfiguration instance, but accept a delegate that enables IConfiguration to be retrieved from the IServiceProvider when IOptions<TOptions> is requested.

However, this requires IConfiguration to be registered in the service container.

@fredrikhr
Copy link
Author

Alternatively, the configAccessor argument could be changed to a Func<IServiceProvider, IConfiguration> delegate instead. This might give people a better idea of what this overload is for, as it would line up with the AddSingleton (and related) extension methods.

@ghost ghost removed the cla-already-signed label Nov 14, 2017
@ghost ghost deleted a comment from dnfclas Nov 14, 2017
@HaoK
Copy link
Member

HaoK commented Nov 21, 2017

This should no longer be needed, you should be able to do something similar via the new Configure overload that hangs off OptionsBuilder that accepts generic dependencies,

see edc21af

@HaoK HaoK closed this Nov 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants