7 questions
1
vote
1
answer
67
views
IOptions doesn't load settings from json
This is my appsettings.json file:
{
{
"User": {
"Name": "Marco",
"Level": "developer",
"Password": "54321"
...
-1
votes
1
answer
36
views
How to inject IOption<T> into class using IWebHost builder's AddHttpClient() without UseStartup()
I am trying inject my IOptions into a class that requires a HttpClient and IOptions.
public class MyHttpService : IMyHttpService
{
private readonly HttpClient _httpClient;
private readonly ...
0
votes
1
answer
311
views
ValidateOnStart() and [Required] don't seem to work
I have an appsettings.json with the following contents:
{
"Settings": {
"Greeting": "Hello World"
}
}
that I associate with
public sealed class ...
1
vote
1
answer
67
views
How to bind list of Enviroment Variables to Options in .NET
I have a list of environment variables located on kubernetes pod where my application is hosted, it`s have no sections, only list of variables that looks like this:
KAFKA_BOOTSTRAP_SERVERS
...
2
votes
1
answer
95
views
Get a collection of all IOptions objects with autofac
I'd like to be able to get a collection of all IOptions<T> registered in autofac so that I can save them to a custom JSON file. Something like:
class OptionsManager(IEnumerable IOptions)
I don'...
0
votes
0
answers
79
views
MassTransit and IOptions injection of Consumer by binding
Is it possible to use the same consumer but distinguished by options?
I tried in this way but the options are always the same for all consumers.
I defined the options here
services.Configure<...
0
votes
2
answers
413
views
How to register an instantiated object as IOptions in .NET Core
I have a consul server and I am using its key/value functionality to centralize my configuration. so, I have a key value like this:
"appSetting": {
"secret": "my-secret&...