ApiBehaviorOptions ApiBehaviorOptions ApiBehaviorOptions ApiBehaviorOptions Class

Definition

Options used to configure behavior for types annotated with ApiControllerAttribute.

public ref class ApiBehaviorOptions : System::Collections::Generic::IEnumerable<Microsoft::AspNetCore::Mvc::Infrastructure::ICompatibilitySwitch ^>
public class ApiBehaviorOptions : System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Mvc.Infrastructure.ICompatibilitySwitch>
type ApiBehaviorOptions = class
    interface seq<ICompatibilitySwitch>
    interface IEnumerable
Public Class ApiBehaviorOptions
Implements IEnumerable(Of ICompatibilitySwitch)
Inheritance
ApiBehaviorOptionsApiBehaviorOptionsApiBehaviorOptionsApiBehaviorOptions
Implements

Constructors

ApiBehaviorOptions() ApiBehaviorOptions() ApiBehaviorOptions() ApiBehaviorOptions()

Creates a new instance of ApiBehaviorOptions.

Properties

AllowInferringBindingSourceForCollectionTypesAsFromQuery AllowInferringBindingSourceForCollectionTypesAsFromQuery AllowInferringBindingSourceForCollectionTypesAsFromQuery AllowInferringBindingSourceForCollectionTypesAsFromQuery

Gets or sets a value that determines if BindingSource for collection types (IsCollectionType).

When true, the binding source for collection types is inferred as Query. Otherwise Body is inferred.

ClientErrorMapping ClientErrorMapping ClientErrorMapping ClientErrorMapping

Gets a map of HTTP status codes to ClientErrorData. Configured values are used to transform IClientErrorActionResult to an ObjectResult instance where the Value is ProblemDetails.

Use of this feature can be disabled by resetting SuppressMapClientErrors.

InvalidModelStateResponseFactory InvalidModelStateResponseFactory InvalidModelStateResponseFactory InvalidModelStateResponseFactory

Delegate invoked on actions annotated with ApiControllerAttribute to convert invalid ModelStateDictionary into an IActionResult

SuppressConsumesConstraintForFormFileParameters SuppressConsumesConstraintForFormFileParameters SuppressConsumesConstraintForFormFileParameters SuppressConsumesConstraintForFormFileParameters

Gets or sets a value that determines if an multipart/form-data consumes action constraint is added to parameters that are bound from form data.

SuppressInferBindingSourcesForParameters SuppressInferBindingSourcesForParameters SuppressInferBindingSourcesForParameters SuppressInferBindingSourcesForParameters

Gets or sets a value that determines if model binding sources are inferred for action parameters on controllers annotated with ApiControllerAttribute is suppressed.

When enabled, the following sources are inferred: Parameters that appear as route values, are assumed to be bound from the path (Path). Parameters of type IFormFile and IFormFileCollection are assumed to be bound from form. Parameters that are complex (IsComplexType) are assumed to be bound from the body (Body). All other parameters are assumed to be bound from the query.

SuppressMapClientErrors SuppressMapClientErrors SuppressMapClientErrors SuppressMapClientErrors

Gets or sets a value that determines if controllers with ApiControllerAttribute transform certain client errors.

When false, a result filter is added to API controller actions that transforms IClientErrorActionResult. Otherwise, the filter is suppressed.

By default, ClientErrorMapping is used to map IClientErrorActionResult to a ProblemDetails instance (returned as the value for ObjectResult).

To customize the output of the filter (for e.g. to return a different error type), register a custom implementation of IClientErrorFactory in the service collection.

SuppressModelStateInvalidFilter SuppressModelStateInvalidFilter SuppressModelStateInvalidFilter SuppressModelStateInvalidFilter

Gets or sets a value that determines if the filter that returns an BadRequestObjectResult when ModelState is invalid is suppressed. .

SuppressUseValidationProblemDetailsForInvalidModelStateResponses SuppressUseValidationProblemDetailsForInvalidModelStateResponses SuppressUseValidationProblemDetailsForInvalidModelStateResponses SuppressUseValidationProblemDetailsForInvalidModelStateResponses

Gets or sets a value that determines if controllers annotated with ApiControllerAttribute respond using ValidationProblemDetails in InvalidModelStateResponseFactory.

When true, SuppressModelStateInvalidFilter returns errors in ModelStateDictionary as a ValidationProblemDetails. Otherwise, SuppressModelStateInvalidFilter returns the errors in the format determined by SerializableError.

Explicit Interface Implementations

IEnumerable<ICompatibilitySwitch>.GetEnumerator() IEnumerable<ICompatibilitySwitch>.GetEnumerator() IEnumerable<ICompatibilitySwitch>.GetEnumerator() IEnumerable<ICompatibilitySwitch>.GetEnumerator()
IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator()

Applies to