I am looking at the ASP.NET MVC 4 Beta version of Web API.
What is the proper approach to implementing IHttpControllerFactory.CreateController(HttpControllerContext controllerContext, string controllerName)? The DefaultHttpControllerFactory has two interesting behaviours in addition to resolving the Type from the
1. It creates an HttpControllerDescriptor and attaches it to the HttpControllerContext. If you don't do this bad things happen!
2. To create the actual instance, it calls the registered IHttpControllerActivator passing the HttpControllerContext and calls its Create method passing through the HttpControllerContext and whatever Type it has resolved. The DefaultHttpControllerActivator
ends up using the DependencyResolver.GetService to get the actual instance.
From this, should we surmise that IHttpControllerFactory is really more of a controller name -> Type resolver? Is it preferred that custom factories call whatever IHttpControllerActivator is registered or go their own way?
(I've posted this on ASP.NET as well, I will cross-post replies back - I'm not really sure what site to use now!)