jamescrosswell / CommandRouting

A DNX alternative to MVC that lets you route directly to CQRS style command handlers.
MIT License
3 stars 3 forks source link

I want to be able to configure [default] options for command routing #7

Closed jamescrosswell closed 8 years ago

jamescrosswell commented 8 years ago

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.