The DefaultControllerFactory contains three different methods:
GetControllerInstanceCreateControllerGetControllerType
When is each method executed in the request lifetime? I’ve seen custom controller factories where one of these methods is overridden and implemented but I can’t seem to find details on the execution path of each one.
CreateControllergets called.It first calls
GetControllerTypeto figure out type of the controller, then passes this type toGetControllerInstance.Because it is easier (and often enough) to (only) override
GetControllerInstance(so that the logic behind selecting the type remains the same), you’d often see this happening.