You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
IServiceCollection Configure should have an overload taking Func<TOptions> #85276
Is your feature request related to a problem? Please describe the problem.
I'm not exactly sure why, but at the moment the only way of setting up options with a factory in ASP.NET is to take an unconfigured instance of an options object, and modify it to have the correct values. There doesn't appear to be a way to just return the options object from the factory.
Describe the solution you'd like
There should be an overload in OptionsServiceCollectionExtensions of Configure that takes a Func<TOptions> so I can just return an options set instead of having to map each value manually. I have an overarching options object I first bind, then configure subsets of that options object that may need to be pulled in. Currently I need to do this:
Triage: we don't see any usecase for this feature shared and in general the idea sounds interesting but rather niche. There is an obvious workaround using a custom IOptionsFactory implementation.
Activity
rosebyte commentedon Mar 17, 2026
Triage: we don't see any usecase for this feature shared and in general the idea sounds interesting but rather niche. There is an obvious workaround using a custom IOptionsFactory implementation.
Improve eval coverage: tighten workaround assertion, add niche API pr…