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. linux下查看服务器软件的编译参数

    1.nginx编译参数: your_nginx_dir/sbin/nginx -V 2.apache编译参数: cat your_apache_dir/build/config.nice 3.php编 ...

  2. C# DateTime.Now详细用法

    //2008年4月24日 System.DateTime.Now.ToString("D"); //2008-4-24 System.DateTime.Now.ToString(& ...

  3. 【BZOJ4099】Trapped in the Haybales Gold STL

    [BZOJ4099]Trapped in the Haybales Gold Description Farmer John has received a shipment of N large ha ...

  4. Gallery 里面怎么设置ImageView的OnClick事件

    Gallery g=this.findViewById(R.id.gallery); g.setOnItemClickListener(new OnItemClickListener(){ @Over ...

  5. thinkphp---自动验证的问题

    这段时间做一个项目:使用 thinkphp 做了一个自动验证,但是发现如果新增的时候,是能够进行自动验证的,但是在修改的修改的时候,会发现自动验证会失效. 验证的时候,模型是这样写的: protect ...

  6. phpcms输出logo下拉实例

    {pc:content action=" siteid="$siteid" order="listorder ASC"} {loop $data $k ...

  7. yum whatprovides 查找哪个包可以提供缺失的文件

    yum whatprovides 查找哪个包可以提供缺失的文件

  8. Maven的pom文件配置

    pom.xml文件如下: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http:// ...

  9. mysql 数据操作 单表查询 limit 限制查询的记录数

    mysql; +----+-----------+------+-----+------------+---------+--------------+------------+--------+-- ...

  10. OC如何跳到系统设置里的各种设置界面

    当 iOS系统版本 <= iOS7时 , 只能跳转到 系统设置页面 ,楼主试了下,非真机是没有任何效果的 当iOS系统版本 < iOS 10.0 时 NSURL *url= [NSURL ...