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 use the TResponse of one route pipeline as the TRequest for another route pipeline #19

Open jamescrosswell opened 8 years ago

jamescrosswell commented 8 years ago

This might look something like this:

            builder
                .Get("")
                .As<JumpRequest>()
                .Pipe<Seargent, Private>();
                .RoutesTo<Foo, Bar>();

Private would be QueryHandler<T, Bar> and Foo would be QueryHandler<Bar, X> so the output of Private (the last handler in pipeline one) would have to match the input of Foo (the first handler in pipeline two).

This is tricky to implement, however. This might require some extension methods that are a bit onerous to build and which also might require another generic type parameter for the Pipe method (specifying the TResponse type of the last query handler in the chain).

Would have to play with this to see if it's doable.