public IHttpController Create(HttpRequestMessage request, HttpControllerDescriptor controllerDescriptor, Type controllerType) { // Change the line below to whatever suits your needs. var controller = _reader.CreateController(new MyImplementation()); return(controller); }
public IHttpController CreateController(HttpControllerContext controllerContext, string controllerName) { if (controllerName == null) { throw new HttpException(404, string.Format("The controller for path '{0}' could not be found.", controllerContext.Request.RequestUri.AbsolutePath)); } // Change the line below to whatever suits your needs. var controller = _reader.CreateController(new MyImplementation()); controllerContext.Controller = controller; controllerContext.ControllerDescriptor = new HttpControllerDescriptor(configuration, controllerName, controller.GetType()); return(controllerContext.Controller); }