ProducesErrorResponseTypeAttribute Class

Definition

Specifies the type returned by default by controllers annotated with ApiControllerAttribute.

Type specifies the error model type associated with a ProducesResponseTypeAttribute for a client error (HTTP Status Code 4xx) when no value is provided. When no value is specified, MVC assumes the client error type to be ProblemDetails, if mapping client errors (ClientErrorMapping) is used.

Use this Attribute to configure the default error type if your application uses a custom error type to respond.

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
Inheritance
ProducesErrorResponseTypeAttribute
Attributes

Constructors

ProducesErrorResponseTypeAttribute(Type)

Initializes a new instance of ProducesErrorResponseTypeAttribute.

Properties

Type

Gets the default error type.

Applies to