What is the equivalent of DefaultControllerFactory in Web API?

前端 未结 1 1441
心在旅途
心在旅途 2021-01-04 10:22

We are trying to replace previous DefaultControllerFactory with new ASP.NET Web API to better handle REST/XML calls. Searching the web always pointed to implementating

相关标签:
1条回答
  • 2021-01-04 11:00

    It is IHttpControllerActivator implemented by DefaultHttpControllerActivator.

    You may replaces it using:

    GlobalConfiguration.Configuration.Services.Replace(typeof(IHttpControllerActivator), 
            new MyOwnActivatior());
    

    Oops!

    I meant IHttpControllerSelector!


    It is IHttpControllerSelector implemented by DefaultHttpControllerSelector.

    You may replaces it using:

    GlobalConfiguration.Configuration.Services.Replace(typeof(IHttpControllerSelector), 
            new MyOwnActivatior());
    
    0 讨论(0)
提交回复
热议问题