0

I have two types of controllers:

[1] Inherited from BaseController (namespace: Foo.Bar.Controllers)

[2] Inherited from BaseAPIController (namespace: Foo.Bar.Controllers.API)

How I can route all /api/{controller}/{action} requests to controllers [2] and all other request to controllers [1] ?

note: I don't use Web API framework, just MVC 5

Coddy
  • 165
  • 1
  • 2
  • 12

1 Answers1

0

My solution to this question should work, I don't think the routing logic is specific to WebAPI.

Basically write a custom IHttpControllerSelector that takes custom namespaces in consideration.

Community
  • 1
  • 1
Norrin
  • 385
  • 2
  • 8