79643121

Date: 2025-05-28 23:42:57
Score: 1.5
Natty:
Report link

I think all the answers are amazing and valid in case of me trying to register a set of options based on another set of options

but what I want to get an instance of IOptions<AppSettings> to do something like this:

var appSettings = sp.GetRequiredService<IOptions<AppSettings>>().Value;
if (appSettings.EnableDebugTools){
    // some code here 
}

this is during ConfigureServices()

Reasons:
  • RegEx Blacklisted phrase (1): I want
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Dhruv Mathur