For example, something like the following in the ConfigureServices method:
services.AddCommandRouting()
.AddJsonOptions(opts =>
{
opts.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
});
AddCommandRouting could configure any default dependencies that command routing needs (e.g. the default Input and Output formatters). It could then return a CommandRoutingServicesBuilder or something that we can use to configure other stuff fluently... In both cases, all we'll be doing is registering a CommandRoutingOptions singleton that the service injector resolves whenever our other plumbing needs it.
For example, something like the following in the
ConfigureServices
method:AddCommandRouting
could configure any default dependencies that command routing needs (e.g. the default Input and Output formatters). It could then return aCommandRoutingServicesBuilder
or something that we can use to configure other stuff fluently... In both cases, all we'll be doing is registering aCommandRoutingOptions
singleton that the service injector resolves whenever our other plumbing needs it.