ObjectResult 類別

定義

執行 ActionResult 時,會使用主機所提供的機制,將物件寫入回應。

public ref class ObjectResult : Microsoft::AspNetCore::Mvc::ActionResult
public ref class ObjectResult : Microsoft::AspNetCore::Mvc::ActionResult, Microsoft::AspNetCore::Mvc::IActionResult, Microsoft::AspNetCore::Mvc::Infrastructure::IStatusCodeActionResult
public class ObjectResult : Microsoft.AspNetCore.Mvc.ActionResult
public class ObjectResult : Microsoft.AspNetCore.Mvc.ActionResult, Microsoft.AspNetCore.Mvc.IActionResult, Microsoft.AspNetCore.Mvc.Infrastructure.IStatusCodeActionResult
type ObjectResult = class
    inherit ActionResult
type ObjectResult = class
    inherit ActionResult
    interface IStatusCodeActionResult
    interface IActionResult
type ObjectResult = class
    inherit ActionResult
    interface IActionResult
    interface IStatusCodeActionResult
Public Class ObjectResult
Inherits ActionResult
Public Class ObjectResult
Inherits ActionResult
Implements IActionResult, IStatusCodeActionResult
繼承
ObjectResult
衍生
實作

建構函式

ObjectResult(Object)

使用提供的 value 建立新的 ObjectResult 實例。

屬性

ContentTypes

取得或設定 MediaTypeCollection

DeclaredType

取得或設定宣告的類型。

Formatters

IOutputFormatter 集合。

StatusCode

取得或設定 HTTP 狀態碼。

Value

物件結果。

方法

ExecuteResult(ActionContext)

同步執行動作方法的結果作業。 MVC 會呼叫這個方法來處理動作方法的結果。

(繼承來源 ActionResult)
ExecuteResultAsync(ActionContext)

以非同步方式執行動作方法的結果作業。 MVC 會呼叫這個方法來處理動作方法的結果。

OnFormatting(ActionContext)

這個方法會在格式器寫入輸出資料流程之前呼叫。

適用於