I am using generic host for a console app (not a daemon style service, just a shortlived app) by .AddHostedService() (I guess I can use a transient or singleton, but I don't know how to instantiate it).
Construction Injection of IOptions<MyConfigClass>, ILogger<MyServiceClass> etc. works fine for json provider.
however, I would (preferably) like to use CommandLine provider for setting one of the properties of the T object from args array, but don't understand how to do this.
Alternatively I would like to inject one string out of args directly, but don't know how to this either.
Someone hint me?