_From @damianh on Tuesday, December 5, 2017 4:22:48 AM_
Usecase: Configuring named OIDC options at runtime where one would like to make a db lookup for value.
_Copied from original issue: aspnet/Options#246_
Triage: we are not going to implement this at this time. However, with appropriate feedback we could revisit this.
Well that's unfortunate. Guess I'll just have keep thus yucky code in my application 馃槥
public void Configure(string name, OpenIdConnectOptions options)
{
var config = Task
.Run(async () => await _config.Retrieve())
.WaitAndUnwrapException();
options.Authority = org.IdpConfig.Authority;
options....
}
@ajcvickers where would be the right place to provide use cases for this. all similar issues have been closed as not a target for 2.0 (which is perfectly fine) but there should at least be one item to discuss it and solutions.
I believe there's a growing concern (ex: https://twitter.com/davidfowl/status/1042451628316536833 )in the aspnet core team around things like MyAsyncFunc().GetAwaiter().GetResult() to synchronize async code or worse things like Task.Run(() => MyAsyncFunc()).GetAwaiter().GetResult() (https://twitter.com/davidfowl/status/1042628651450134528).
Can someone reopen this issue, or should I open a new one? Also would it be possible to make it more generic as it's the whole IOptions stack which deserve a bit more of Async friendlyness.
Most helpful comment
@ajcvickers where would be the right place to provide use cases for this. all similar issues have been closed as not a target for 2.0 (which is perfectly fine) but there should at least be one item to discuss it and solutions.