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. php中关于时间的用法

    一.时间戳相关:        当前时间戳:time();         把时间戳转换为时间显示:date("Y-m-d H:i:s", $a);         把日期时间转换 ...

  2. 代码片段,Lucene的高亮显示

    代码高亮显示是通过在搜索到的Term中把匹配了用户输入的关键字的周围加上一些标记来实现(比如,关键字是 "中华" 查到的一个Term是 "中华人民共和国",则把 ...

  3. [MongoDB] 机器换IP之后的设置

    组里用的几台机器换了网段,MongoDB需要做重新配置. 查看Replica Set的状态如下: rs.status() { "startupStatus" : 1, " ...

  4. 2.06StuModify.aspx(修改姓名,性别,所在班级)

    meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title ...

  5. 传智播客微金所项目实战移动web开发

    1.源码笔记 我的源码+笔记(很重要):链接: http://pan.baidu.com/s/1kULKqcJ 感谢传智播客项目相关视频:1.6天 链接: https://pan.baidu.com/ ...

  6. pandas的Categorical方法

    对于数据样本的标签,如果我们事先不知道这个样本有多少类别,那么可以对数据集的类别列进行统计,这时我们用pandas的Categorical方法就非常快的实现. 1.说明: 你的数据最好是一个serie ...

  7. 基于linux-2.6.35的class_create(),device_create解析

    基于linux-2.6.35的class_create(),device_create解析 作者:苗老师,华清远见嵌入式学院讲师. 从linux内核2.6的某个版本之后,devfs不复存在,udev成 ...

  8. With all Java versions it is strongly recommended to not use experimental -XX JVM options.

    https://lucene.apache.org/solr/7_6_0//SYSTEM_REQUIREMENTS.html System Requirements Apache Solr runs ...

  9. console access jquery--------json

    jq = document.createElement('script');  jq.src = "file:///home/liulqiang/jquery.js";  docu ...

  10. Mybatis三剑客之mybatis-plugin

    搜索mybatis plugin并安装. 如果没有的话,就按照如下: 1. 简介     mybatis plugin作为一款优秀的mybatis跳转插件,比起free mybatis plugin插 ...