So I'm having issues trying to get Visual Studio to add user secrets to a property that is an array. I have a feeling this sort of thing can't be done but I really need to have a way of iterating through the each of them for what I'm doing and I'm not allowed to store the clientSecrets in the standard appsettings file for obvious reason.
Is there a way of doing this and if not is there a way I could change this object to make it iterable in C# which also allows me to store the passwords in the user secrets?
The object below shows the current shape of the appsettings which I'm trying to store the values into:
{
"TestClients": [
{
"ClientSecret": ""
},
{
"ClientSecret": ""
},
{
"ClientSecret": ""
},
{
"ClientSecret": ""
},
{
"ClientSecret": ""
},
{
"ClientSecret": ""
},
{
"ClientSecret": ""
},
{
"ClientSecret": ""
}
]
}
I have tried turning it into a object and iterating through the keys but the console app I'm working with doesn't seem to find the section TestClients when the object is shaped like this:
{
"TestClients": {
"ClientName": {
"ClientSecret": ""
}
}
}