ProducesResponseTypeAttribute 類別

定義

指定動作所傳回之值和狀態碼類型的篩選。

public ref class ProducesResponseTypeAttribute : Attribute, Microsoft::AspNetCore::Mvc::ApiExplorer::IApiResponseMetadataProvider, Microsoft::AspNetCore::Mvc::Filters::IFilterMetadata
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true, Inherited=true)]
public class ProducesResponseTypeAttribute : Attribute, Microsoft.AspNetCore.Mvc.ApiExplorer.IApiResponseMetadataProvider, Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true, Inherited=true)>]
type ProducesResponseTypeAttribute = class
    inherit Attribute
    interface IApiResponseMetadataProvider
    interface IFilterMetadata
Public Class ProducesResponseTypeAttribute
Inherits Attribute
Implements IApiResponseMetadataProvider, IFilterMetadata
繼承
ProducesResponseTypeAttribute
衍生
屬性
實作

建構函式

ProducesResponseTypeAttribute(Int32)

初始化 ProducesResponseTypeAttribute 的執行個體。

ProducesResponseTypeAttribute(Type, Int32)

初始化 ProducesResponseTypeAttribute 的執行個體。

ProducesResponseTypeAttribute(Type, Int32, String, String[])

初始化 ProducesResponseTypeAttribute 的執行個體。

屬性

StatusCode

取得或設定回應的 HTTP 狀態碼。

Type

取得或設定動作所傳回之值的型別。

明確介面實作

IApiResponseMetadataProvider.SetContentTypes(MediaTypeCollection)

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

適用於