ProducesErrorResponseTypeAttribute クラス

定義

で注釈が付けられたコントローラーによって既定で返される型を ApiControllerAttribute指定します。

Type は、値が指定されていない場合にクライアント エラー (HTTP 状態コード 4xx) の に関連付 ProducesResponseTypeAttribute けられているエラー モデルの種類を指定します。 値が指定されていない場合、マッピング クライアント エラー (ClientErrorMapping) が使用されている場合、MVC はクライアント エラーの種類 が であるとProblemDetails見なします。

アプリケーションでカスタム エラーの種類を使用して応答する場合は、これを Attribute 使用して既定のエラーの種類を構成します。

public ref class ProducesErrorResponseTypeAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)]
public sealed class ProducesErrorResponseTypeAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)>]
type ProducesErrorResponseTypeAttribute = class
    inherit Attribute
Public NotInheritable Class ProducesErrorResponseTypeAttribute
Inherits Attribute
継承
ProducesErrorResponseTypeAttribute
属性

コンストラクター

ProducesErrorResponseTypeAttribute(Type)

ProducesErrorResponseTypeAttribute の新しいインスタンスを初期化します。

プロパティ

Type

既定のエラーの種類を取得します。

適用対象