After a controller's type is located, ASP.NET Core starts a process to instantiate it. The process is as follows:
- The default controller factory (IControllerFactory) is obtained from the dependency injection (DI) framework and its CreateController method is called.
- The controller factory uses the registered controller activator (IControllerActivator), also obtained from the DI, to obtain an instance to the controller (IControllerActivator.Create).
- The action method is located using the IActionSelector from the DI.
- If the controller implements any filter interfaces (IActionFilter, IResourceFilter, and more), or if the action has any filter attributes, then the appropriate methods are called upon it and on global filters.
- The action method is called by the IActionInvoker from the IActionInvokerProvider, also obtained from the DI.
- Any filter methods are called upon the controller, the...