-
Is there a way to add a json file to the configurations and update it at runtime? I don't need to have the file bundled in from the start.
The idea would be to retrieve this file later, change it and so that all the The only solution that works that I've found is setting the values manually like ---- Update ---- |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Beta Was this translation helpful? Give feedback.
-
If anyone sees this, is there a way to store this file so it can't be access to the user? any tips? |
Beta Was this translation helpful? Give feedback.
Well dumb me 😊, the mistake is that using this line
JsonSerializer.Serialize(new AppSettings { ConnectionString = "start string" })
the file content will be
{"ConnectionString":"start string"}
If i want this result
{"AppSettings":{"ConnectionString":"start string"}}
i should do
JsonSerializer.Serialize(new { AppSettings = new AppSettings { ConnectionString = "start string" } })
Woowiiee, i have the updated options in the
optionsMonitor.OnChange
callback now.