ProducesErrorResponseTypeAttribute Klasa

Definicja

Określa typ zwracany domyślnie przez kontrolery z adnotacjami .ApiControllerAttribute

Type określa typ modelu błędu skojarzony z ProducesResponseTypeAttribute błędem klienta (kod stanu HTTP 4xx), jeśli nie podano żadnej wartości. Jeśli nie określono żadnej wartości, MVC zakłada, że typ błędu klienta ma być ProblemDetails, jeśli są używane błędy klienta mapowania (ClientErrorMapping).

Użyj tego Attribute polecenia, aby skonfigurować domyślny typ błędu, jeśli aplikacja używa niestandardowego typu błędu do reagowania.

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
Dziedziczenie
ProducesErrorResponseTypeAttribute
Atrybuty

Konstruktory

ProducesErrorResponseTypeAttribute(Type)

Inicjuje nowe wystąpienie klasy ProducesErrorResponseTypeAttribute.

Właściwości

Type

Pobiera domyślny typ błędu.

Dotyczy