Reputation: 8757
In Startup.cs I want to configure 2 middlewares:
How the router can be created and reused in MVC in such situation?
PS. Here is my related question where I am looking at the same problem from a different perspective: Opening a websocket channel inside MVC controller
Upvotes: 3
Views: 498
Reputation: 2280
I had similar issue and after checking the sources I found that the UseMvc
method creates its own instance of RouteBuilder
and IRouter
. This means that you have no control over the route creation while using UseMvc
.
So I can suggest creating an alternative to UseMvc
that will create two routes mapped to different handlers, one to Mvc and the second to Websocket. Though I haven't tested it yet, hope it helps.
Upvotes: 1