command-line-api icon indicating copy to clipboard operation
command-line-api copied to clipboard

Extend IHostBuilder configuration based on command

Open Zetanova opened this issue 2 years ago • 1 comments

It is currently not possible to configure the IHostBuilder depended on the executed command. I could not find an elegant pattern to register some IHostedService based on the command. IHost is managing the registered IHostedService's

Example: my-cli get something //no background service required and registered my-cli serve //IHostedService should be registered

Zetanova avatar Dec 12 '23 13:12 Zetanova

+1 It would be very useful! at this moment it is really PITA. I'm needed to configure app dbcontext and other services based on CommandLine inputs, and I got really struggled with that

Nova-Logic avatar Dec 20 '23 22:12 Nova-Logic