ProducesErrorResponseTypeAttribute Класс

Определение

Указывает тип, возвращаемый по умолчанию контроллерами с заметками ApiControllerAttribute.

Type указывает тип модели ошибок, связанный с , ProducesResponseTypeAttribute для ошибки клиента (код состояния HTTP 4xx), если значение не указано. Если значение не указано, MVC предполагает, что тип ошибки клиента — ProblemDetails, если используется сопоставление ошибок клиента (ClientErrorMapping).

Используйте этот Attribute параметр, чтобы настроить тип ошибки по умолчанию, если приложение использует пользовательский тип ошибки для реагирования.

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
Наследование
ProducesErrorResponseTypeAttribute
Атрибуты

Конструкторы

ProducesErrorResponseTypeAttribute(Type)

Инициализирует новый экземпляр ProducesErrorResponseTypeAttribute.

Свойства

Type

Возвращает тип ошибки по умолчанию.

Применяется к