ProducesErrorResponseTypeAttribute Classe

Definizione

Specifica il tipo restituito per impostazione predefinita dai controller annotati con ApiControllerAttribute.

Type specifica il tipo di modello di errore associato a un ProducesResponseTypeAttribute errore client (codice di stato HTTP 4xx) quando non viene fornito alcun valore. Quando non viene specificato alcun valore, MVC presuppone che il tipo di errore del client sia ProblemDetails, se viene usato il mapping degli errori client (ClientErrorMapping).

Usare questa opzione Attribute per configurare il tipo di errore predefinito se l'applicazione usa un tipo di errore personalizzato per rispondere.

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
Ereditarietà
ProducesErrorResponseTypeAttribute
Attributi

Costruttori

ProducesErrorResponseTypeAttribute(Type)

Inizializza una nuova istanza di ProducesErrorResponseTypeAttribute.

Proprietà

Type

Ottiene il tipo di errore predefinito.

Si applica a