本篇主要講述MVC處理請(qǐng)求時(shí)創(chuàng)建Controller和執(zhí)行Action的完整過(guò)程。

創(chuàng)建Controller

先查看MvcHandler中處理請(qǐng)求的方法BeginProcessRequest:

大數(shù)據(jù)培訓(xùn),云培訓(xùn),數(shù)據(jù)挖掘培訓(xùn),云計(jì)算培訓(xùn),高端軟件開(kāi)發(fā)培訓(xùn),項(xiàng)目經(jīng)理培訓(xùn)

        protected internal virtual IAsyncResult BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, object state)

        {

            IController controller;

            IControllerFactory factory;

            ProcessRequestInit(httpContext, out controller, out factory);

            IAsyncController asyncController = controller as IAsyncController;            if (asyncController != null)

            {

                ……

            }            else

            {

                ……

            }

     }

網(wǎng)友評(píng)論