検索
ホームページバックエンド開発C#.Net チュートリアル.NET MyMVCフレームワークでアクションを実行するプロセスの詳細な説明

AjaxHandlerFactory の GetHandler メソッドで、最終的に ActionHandler が作成されます。これは HttpHandler であり、パイプラインの 15 番目のステップで呼び出されます (ブログ [Asp.net で独自のサービス フレームワークを作成する] のシーケンスを引用) 。

注: AjaxHandlerFactory の GetHandler メソッドはステップ 10 で呼び出されます。ステップ 12 ではセッションを準備しています (非インプロセス モード)。そのため、セッションの使用はステップ 12 の前に決定する必要があります。

すべてのアクション コードは ActionHandler で実行されます:

internal class ActionHandler : IHttpHandler{    internal InvokeInfo InvokeInfo;    public void ProcessRequest(HttpContext context)
    {        // 调用核心的工具类,执行Action        ActionExecutor.ExecuteAction(context, this.InvokeInfo);
    }

ExecuteAction の実装プロセスは次のとおりです:

internal static void ExecuteAction(HttpContext context, InvokeInfo vkInfo)
{    if( context == null )        throw new ArgumentNullException("context");    if( vkInfo == null )        throw new ArgumentNullException("vkInfo");    // 调用方法    object result = ExecuteActionInternal(context, vkInfo);    // 设置OutputCache    OutputCacheAttribute outputCache = vkInfo.GetOutputCacheSetting();    if( outputCache != null )
        outputCache.SetResponseCache(context);    // 处理方法的返回结果    IActionResult executeResult = result as IActionResult;    if( executeResult != null ) {
        executeResult.Ouput(context);
    }    else {        if( result != null ) {            // 普通类型结果            context.Response.ContentType = "text/plain";
            context.Response.Write(result.ToString());
        }
    }
}internal static object ExecuteActionInternal(HttpContext context, InvokeInfo info)
{    // 准备要传给调用方法的参数    object[] parameters = GetActionCallParameters(context, info.Action);    // 调用方法    if( info.Action.HasReturn )        return info.Action.MethodInfo.Invoke(info.Instance, parameters);    else {
        info.Action.MethodInfo.Invoke(info.Instance, parameters);        return null;
    }
}

SetResponseCache() を呼び出すタイミングについては前に述べましたよね? このタイミングは、まさにアクションの実行後です。 。
OutputCache を設定したら、戻り値を処理します。

前のコードには、別の重要な呼び出しがあります:

// 准备要传给调用方法的参数object[] parameters = GetActionCallParameters(context, info.Action);

[関連推奨事項]

1。特別な推奨事項: 「php Programmer Toolbox」V0.1 バージョンのダウンロード

2 。ビデオチュートリアル

3.

エントリーレベルの.NET MVCの例

4.

MyMVCボックスでアクションを見つけるプロセスの詳細な説明

5.

.NET MyMVCフレームワークが戻り値を処理します。チュートリアル

6. メソッドに値を割り当てる方法に関する

.NET MyMVCフレームワークのチュートリアル

以上が.NET MyMVCフレームワークでアクションを実行するプロセスの詳細な説明の詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
DJI Osmo Action 5 Pro: Release date mooted as retailer reveals launch pricing that could undercut GoPro Hero 13 BlackDJI Osmo Action 5 Pro: Release date mooted as retailer reveals launch pricing that could undercut GoPro Hero 13 BlackSep 04, 2024 am 06:51 AM

DJI has not confirmed any plans to introduce a new action camera yet. Instead, it seems that GoPro will get ahead of its rival this year, having teased that it will introduce two new action cameras on September 4. For context, these are expected to a

New DJI Osmo action camera spotted before probable summer 2024 launch to rival recent GoPro and Insta360 releasesNew DJI Osmo action camera spotted before probable summer 2024 launch to rival recent GoPro and Insta360 releasesJul 01, 2024 am 09:49 AM

Almost a year has passed since DJI released the Osmo Action 4 (curr. $299 on Amazon). Since then, the company has focused on its other divisions, including new RS camera gimbals. On top of that, it has introduced various drones as well like the Avata

Insta360 Go 3S: New pocketable 4K action camera released weighing just 39 g with Apple Find My supportInsta360 Go 3S: New pocketable 4K action camera released weighing just 39 g with Apple Find My supportJun 14, 2024 pm 06:05 PM

Insta360hasreleasedanewactioncamera,itssecondoftheyearaftertheInsta360X4(curr.$499.99onAmazon).Asexpected,thecompanyhasintroducedtheGo3S,anupgradedthatGo3thatadds4Kvideorecordingcapabilities.Specifically,whileInst

Vuex状态管理之Action异步操作详解Vuex状态管理之Action异步操作详解Aug 10, 2022 pm 03:29 PM

某些情况,我们希望在Vuex中进行一些异步操作, 比如网络请求, 必然是异步的,这个时候怎么处理呢?下面就给大家介绍Vuex状态管理之Action异步操作,希望对需要的朋友有所帮助!

GoPro releases new Hero 13 Black action camera with new lens mods alongside curious GoPro HeroGoPro releases new Hero 13 Black action camera with new lens mods alongside curious GoPro HeroSep 05, 2024 am 06:45 AM

GoPro has now introduced its annual action camera refresh. Unlike in recent years, the company has decided to release two models. However, it has not returned to 360-degree cameras, despite teasing this time last year that it would replace the Max wi

elasticsearch java客户端action怎么实现elasticsearch java客户端action怎么实现May 22, 2023 am 08:43 AM

elasticsearch中的绝大部分操作都是通过相应的action,这些action在action包中。它的结构如下图所示:上图是action包的部分截图,这里面对应着各个功能的action。各个action的包也都非常类似于index。这些action的实现也非常类似,都是基础自action,下图是indexaction的继承关系:因为这些action并未真正实现相应的功能,只是一个代理,因此实现上也非常简单。他们的主要作用是提供新建response和request的方法及对应的action

GoPro Hero: New pocket-sized action camera leaks along with rumoured release dateGoPro Hero: New pocket-sized action camera leaks along with rumoured release dateAug 16, 2024 am 09:43 AM

Details of a completely new GoPro action camera has leaked online alongside equivalent information about the Hero 13 Black. Please note that the information contained below is said to originate from an Amazon US listing that has since now been remove

Deal | Amazfit GTR 3 Pro Limited Edition smartwatch with 12-day battery life, GPS and 1,000 nits AMOLED now available for just $125Deal | Amazfit GTR 3 Pro Limited Edition smartwatch with 12-day battery life, GPS and 1,000 nits AMOLED now available for just $125Aug 15, 2024 am 11:14 AM

The Amazfit GTR 3 Pro Limited Edition is currently on sale at Amazon for just $124.99, down 40% from its list price of $209.99. Compared to the standard version that has an aluminum case, the Amazfit GTR 3 Pro Limited Edition uses hand-polished stain

See all articles

ホットAIツール

Undresser.AI Undress

Undresser.AI Undress

リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover

AI Clothes Remover

写真から衣服を削除するオンライン AI ツール。

Undress AI Tool

Undress AI Tool

脱衣画像を無料で

Clothoff.io

Clothoff.io

AI衣類リムーバー

AI Hentai Generator

AI Hentai Generator

AIヘンタイを無料で生成します。

ホットツール

EditPlus 中国語クラック版

EditPlus 中国語クラック版

サイズが小さく、構文の強調表示、コード プロンプト機能はサポートされていません

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser は、オンライン試験を安全に受験するための安全なブラウザ環境です。このソフトウェアは、あらゆるコンピュータを安全なワークステーションに変えます。あらゆるユーティリティへのアクセスを制御し、学生が無許可のリソースを使用するのを防ぎます。

mPDF

mPDF

mPDF は、UTF-8 でエンコードされた HTML から PDF ファイルを生成できる PHP ライブラリです。オリジナルの作者である Ian Back は、Web サイトから「オンザフライ」で PDF ファイルを出力し、さまざまな言語を処理するために mPDF を作成しました。 HTML2FPDF などのオリジナルのスクリプトよりも遅く、Unicode フォントを使用すると生成されるファイルが大きくなりますが、CSS スタイルなどをサポートし、多くの機能強化が施されています。 RTL (アラビア語とヘブライ語) や CJK (中国語、日本語、韓国語) を含むほぼすべての言語をサポートします。ネストされたブロックレベル要素 (P、DIV など) をサポートします。

SublimeText3 Mac版

SublimeText3 Mac版

神レベルのコード編集ソフト(SublimeText3)

MantisBT

MantisBT

Mantis は、製品の欠陥追跡を支援するために設計された、導入が簡単な Web ベースの欠陥追跡ツールです。 PHP、MySQL、Web サーバーが必要です。デモおよびホスティング サービスをチェックしてください。