ProducesErrorResponseTypeAttribute Třída

Definice

Určuje typ vrácený ve výchozím nastavení kontrolery opatřenými poznámkami ApiControllerAttribute.

Type Určuje typ modelu chyb přidružený k ProducesResponseTypeAttribute chybě klienta (stavový kód HTTP 4xx), pokud není zadána žádná hodnota. Pokud není zadána žádná hodnota, MVC předpokládá, že typ chyby klienta je ProblemDetails, pokud se používá mapování chyb klienta (ClientErrorMapping).

Attribute Tato možnost slouží ke konfiguraci výchozího typu chyby, pokud vaše aplikace k reakci používá vlastní typ chyby.

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
Dědičnost
ProducesErrorResponseTypeAttribute
Atributy

Konstruktory

ProducesErrorResponseTypeAttribute(Type)

Inicializuje novou instanci objektu ProducesErrorResponseTypeAttribute.

Vlastnosti

Type

Získá výchozí typ chyby.

Platí pro