When we have configuration like this
// appsettings.json
{
"SomeServiceConfiguration": {
"Server": "127.0.0.1",
"Port": "25"
}
}
it is possible to use binding to access data:
IConfiguration configuration = ...;
var section = configuration.GetSection("SomeServiceConfiguration");
var val = section.Value; // this is null
var t = new SomeServiceConfiguration();
section.Bind(t);
But is it possible to get value (section content) "just as string" (by the fact as json) {"Server": "127.0.0.1", "Port": "25"}
?