C
C#3y ago
devhl

❔ Get required value from IConfiguration

There is a GetRequiredSection extenion in Microsoft.Extensions.Configuration, but is there a GetRequired to return a non nullable value? Also, why is the second variable here null but the first is not?
4 Replies
devhl
devhlOP3y ago
I'm reading on SO GetValue just doesn't work on complex types. So now just trying to see if there is anything for Get but not returning nullable.
phaseshift
phaseshift3y ago
Oh gosh. Just bind them to a class and or use IOptions
jcotton42
jcotton423y ago
^
Accord
Accord3y ago
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.

Did you find this page helpful?