ProducesAttribute<T> 類別

定義

指定動作會傳回的預期 Type 篩選,以及支援的回應內容類型。 值 ContentTypes 是用來設定 ContentTypes

public class ProducesAttribute<T> : Microsoft.AspNetCore.Mvc.ProducesAttribute
type ProducesAttribute<'T> = class
    inherit ProducesAttribute
Public Class ProducesAttribute(Of T)
Inherits ProducesAttribute

類型參數

T

Type要在回應中寫入之物件的 。

繼承
ProducesAttribute<T>

備註

這是 的 ProducesAttribute 衍生泛型變體。 確定目標上只提供任一屬性的一個實例。

建構函式

ProducesAttribute<T>()

初始化 ProducesAttribute 的執行個體。

屬性

ContentTypes

取得或設定支援的回應內容類型。 用來設定 ContentTypes

(繼承來源 ProducesAttribute)
Order

取得決定篩選準則執行順序的順序值。 篩選會以屬性的 Order 遞增數值執行。

(繼承來源 ProducesAttribute)
StatusCode

取得回應的 HTTP 狀態碼。

(繼承來源 ProducesAttribute)
Type

取得動作的開放式傳回型別。

(繼承來源 ProducesAttribute)

方法

OnResultExecuted(ResultExecutedContext)

在動作結果執行之後呼叫。

(繼承來源 ProducesAttribute)
OnResultExecuting(ResultExecutingContext)

在動作結果執行之前呼叫。

(繼承來源 ProducesAttribute)
SetContentTypes(MediaTypeCollection)

設定允許的內容類型集合,這些內容類型可由動作產生。

(繼承來源 ProducesAttribute)

適用於