❔ IOptions pattern in WebAPI getting null value
I'm trying to use the IOptions pattern with Dep. Injection, however when i debug the code i get null values in the injected object.
I've tried to use the
.AddOptions()
method to the builder
ServiceCollection
but still i get null values6 Replies
whats the appsettings config look like?
are members of
Bot
properties?No theyre fields - that's likely the issue. I don't think config/options binding work with fields?
oops i didn't see the image
it doesn't
maybe there's a specific setting to enable it, but it's unusual and not recommended
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.