ProducesErrorResponseTypeAttribute Třída
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
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. |