ProducesDefaultResponseTypeAttribute 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
篩選準則,指定 Type 未涵蓋 ProducesResponseTypeAttribute 的所有 HTTP 狀態碼。
public ref class ProducesDefaultResponseTypeAttribute sealed : Attribute, Microsoft::AspNetCore::Mvc::ApiExplorer::IApiDefaultResponseMetadataProvider, Microsoft::AspNetCore::Mvc::Filters::IFilterMetadata
[System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)]
public sealed class ProducesDefaultResponseTypeAttribute : Attribute, Microsoft.AspNetCore.Mvc.ApiExplorer.IApiDefaultResponseMetadataProvider, Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata
[<System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)>]
type ProducesDefaultResponseTypeAttribute = class
inherit Attribute
interface IApiDefaultResponseMetadataProvider
interface IApiResponseMetadataProvider
interface IFilterMetadata
Public NotInheritable Class ProducesDefaultResponseTypeAttribute
Inherits Attribute
Implements IApiDefaultResponseMetadataProvider, IFilterMetadata
- 繼承
-
ProducesDefaultResponseTypeAttribute
- 屬性
- 實作
建構函式
ProducesDefaultResponseTypeAttribute() |
初始化 ProducesResponseTypeAttribute 的執行個體。 |
ProducesDefaultResponseTypeAttribute(Type) |
初始化 ProducesResponseTypeAttribute 的執行個體。 |
屬性
StatusCode |
取得或設定回應的 HTTP 狀態碼。 |
Type |
取得或設定動作所傳回之值的型別。 |
明確介面實作
IApiResponseMetadataProvider.SetContentTypes(MediaTypeCollection) |
設定允許的內容類型集合,這些內容類型可由動作產生。 |
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應