ProducesErrorResponseTypeAttribute Třída

Definice

Určuje typ vrácený ve výchozím nastavení kontrolery s poznámkami ApiControllerAttribute.

Type určuje typ modelu chyby asociované s chybou ProducesResponseTypeAttribute klienta (stavový kód HTTP 4xx), pokud není zadána žádná hodnota. Pokud není zadána žádná hodnota, MVC předpokládá typ ProblemDetailschyby klienta , pokud se použijí chyby klienta (ClientErrorMapping).

Tento postup Attribute slouží ke konfiguraci výchozího typu chyby, pokud vaše aplikace používá vlastní typ chyby k odpovědi.

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 .ProducesErrorResponseTypeAttribute

Vlastnosti

Type

Získá výchozí typ chyby.

Platí pro