Let's assume we have this section in appsettings.json
{
"crypto":{
"A": "some value",
"B": "foo foo",
"C": "last part"
},
...
}
Where "crypto"
is json serialization of some cryptographic key.
Later in the code, I need to make something like this:
var keyOptions = CryptoProvider.RestoreFromJson(Configuration.GetSection("crypto"))
But Configuration.GetSection
return ConfigurationSection
instance. Is there a way to get raw json data behind it somehow?
I assumed that ConfigurationSection.Value
should do the trick, but for some reason it's always null
.