Execution Order for the ApiController

Assuming the request goes into the ApiController scope, the operation order is as below:

  • The ExecuteAsync method of the ApiController is invoked.
  • The Initialize method of the ApiController is invoked.
  • The registered Action Selector is retrieved.
  • The SelectAction method of the registered action selector is invoked. If only one action method is matched, the pipeline continues.
  • All registered Filters for the selected action is retrieved.
  • The Authorization Filters are called. The authorization filter can decide either to let the pipeline to continue executing or to terminate the pipeline.
  • If Authorization Filters didn't terminate the request, action parameter bindings are performed.
  • ApiController.ModelState is set.
  • Action Filters are invoked. The Action Filters can decide either to let the pipeline to continue executing or terminate the pipeline.
  • If Action Filters didn't terminate the request, registered Action Invoker is retrieved.
  • The InvokeActionAsync method of the registered Action Invoker is called to invoked the selected action method.
  • Note: If any exception occurs from the execution of the Authorization Filters to the execution of the action method, the exception filters are be called.

There are a few more things which happen in between but this is very close to a complete view. Check out the ApiController source code for more information.

实际使用来看

2019-02-25 16:16:17.668+08:00 INFO [59]: CustomMessageHandler.SendAsync
2019-02-25 16:16:18.107+08:00 INFO [59]: BaseApiController.Initialize

Execution Order for the ApiController的更多相关文章

  1. Execution Order of Event Functions

    In Unity scripting, there are a number of event functions that get executed in a predetermined order ...

  2. unity 脚本执行顺序设置 Script Execution Order Settings

     通过Edit->Project Settings->Script Execution Order打开MonoManager面板  或者选择任意脚本在Inspector视图中点击Execu ...

  3. Unity3D Script Execution Order ——Question

    我 知道 Monobehaviour 上的 那些 event functions 是 在主线程 中 按 顺序调用的.这点从Manual/ExecutionOrder.html 上的 一张图就可以看出来 ...

  4. Test execution order

    刚开始的时候,JUnit并没有规定测试方法的调用执行顺序.方法通过映射的API返回的顺序进行调用.然 而,使用JVM顺序是不明智的,因为Java平台没有规定任何特定的顺序,事实上JDK7或多或少的返回 ...

  5. Execution Order In a Test Plan

    1.Config Element 2.Pre  Processors 3.Timer 4.Sampler 5.Post Processors 6.Assertions 7.Listener

  6. How to define Servlet filter order of execution using annotations

    If we define Servlet filters in web.xml, then the order of execution of the filters will be the same ...

  7. System and method for parallel execution of memory transactions using multiple memory models, including SSO, TSO, PSO and RMO

    A data processor supports the use of multiple memory models by computer programs. At a device extern ...

  8. Unity性能优化(2)-官方教程Diagnosing performance problems using the Profiler window翻译

    本文是Unity官方教程,性能优化系列的第二篇<Diagnosing performance problems using the Profiler window>的简单翻译. 相关文章: ...

  9. Unity中脚本的执行顺序总结(@WhiteTaken)

    (Editor)以上是Unity官方文档中的截图,脚本在被挂载到物体上,会启用Editor的方法Reset. (Initialization)当执行脚本开始,初始化的过程中,依次执行的是Awake-& ...

随机推荐

  1. <a>标签实现链接和锚点的区别

    如果是实现链接,a标签中必须有href属性,并且属性值是合法的url 如果实现锚点,a标签中必须有name属性,当点击该标签时,会跳转到id同该标签的name值相同的元素处.

  2. java EE ME SE有什么关系

    1. Java SE(Java Platform,Standard Edition).Java SE 以前称为 J2SE.它允许开发和部署在桌面.服务器.嵌入式环境和实时环境中使用的 Java 应用程 ...

  3. {sharepoint} More on SharePoint 2010 Application Pools

    More on SharePoint 2010 Application Pools Print | posted on Friday, December 04, 2009 3:26 PM Blimey ...

  4. shell脚本抓取网页信息

    利用shell脚本分析网站数据 # define url time=$(date +%F) mtime=$(date +%T) file=/abc/shell/abc/abc_$time.log ht ...

  5. 百度移动开发平台在用angularJS

  6. treeview(树加载)

    数据库结构 id:int类型,主键,自增列:     Name:char类型:     paraid:int类型 窗台拖入控件treeview. 1.版本1 using System; using S ...

  7. CommonHelper 公共类

      public static class CommonHelper 公共帮助类 using System.Collections.Generic; using System.Linq; using ...

  8. python使用MySqlDB

    下载安装MySQLdb <1>linux版本 http://sourceforge.net/projects/mysql-python/ 下载,在安装是要先安装setuptools,然后在 ...

  9. Android--aapt命令

    1.aapt l[ist] [-v] [-a] file.{zip,jar,apk} 释义:列出压缩文件中的内容 aapt l xxx.apk:简单的罗列压缩文件中每一项的内容 aapt l -v x ...

  10. 省市县三级联动的SQL

    完整版见https://jadyer.github.io/ 首先是建表语句 CREATE TABLE `t_address_province` ( `id` INT AUTO_INCREMENT PR ...