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 System.Web.Http.Dependencies.IDependencyResolver
and then handling the GetService()
and few other methods required by the interface.
However it seems to be caching the ApiController instance and any new controller, it does not seem to be resolving. Its difficult to provide all possible ApiController instances during startup due to performance issues.
DefaultControllerFactory
allows providing controller instances and caches the "hit" entries, but throws errors when the an instane could not be delay loaded.
Are there are other overloads/controller factory methods that requires to be implemented?
Search did not yield any hits so far, but any pointers will be great. Thank you for your time.
It is IHttpControllerActivator
implemented by DefaultHttpControllerActivator
.
You may replaces it using:
GlobalConfiguration.Configuration.Services.Replace(typeof(IHttpControllerActivator),
new MyOwnActivatior());
I meant IHttpControllerSelector
!
It is IHttpControllerSelector
implemented by DefaultHttpControllerSelector
.
You may replaces it using:
GlobalConfiguration.Configuration.Services.Replace(typeof(IHttpControllerSelector),
new MyOwnActivatior());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With