I’ll try to describe my problem as simple as I can. I have several controllers which are loaded dynamically at runtime. Those controllers hosts several web apis for different partners. What I want to achieve is to have a prefix in URL before accessing the controller. In other words, I have Partner1 and Partner2. Both of them has some controllers, for example
Partner1: Service1Controller, Service2Controller2.
Partner2: Api1Controller, Api2Controller etc.
Now I want to achieve the following. I want partner1’s controllers to be accessible only with Partner1 prefix in the url, for example http://somehost.com/Partner1/Service1, but I don’t want Api1Controller to be accessible from http://somehost.com/Partner1/Api1, but instead it should be accessible from http://somehost.com/Partner2/Api1.
Is there any way to achieve my goal?
Thanks
An inelegant solution could be to use 2 separate route mappings:
Teh 4th parameter of MapRoute defines constraints as regular expressions