ApiBehaviorOptions Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Options used to configure behavior for types annotated with ApiControllerAttribute.
public ref class ApiBehaviorOptions
public ref class ApiBehaviorOptions : System::Collections::Generic::IEnumerable<Microsoft::AspNetCore::Mvc::Infrastructure::ICompatibilitySwitch ^>
public class ApiBehaviorOptions
public class ApiBehaviorOptions : System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Mvc.Infrastructure.ICompatibilitySwitch>
type ApiBehaviorOptions = class
type ApiBehaviorOptions = class
interface seq<ICompatibilitySwitch>
interface IEnumerable
Public Class ApiBehaviorOptions
Public Class ApiBehaviorOptions
Implements IEnumerable(Of ICompatibilitySwitch)
- Inheritance
-
ApiBehaviorOptions
- Implements
Constructors
ApiBehaviorOptions() |
Creates a new instance of ApiBehaviorOptions. |
Properties
AllowInferringBindingSourceForCollectionTypesAsFromQuery |
Gets or sets a value that determines if BindingSource for collection types (IsCollectionType).
When |
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. |
DisableImplicitFromServicesParameters |
Gets or sets a value that determines if parameters are inferred to be from services.
This property is only applicable when SuppressInferBindingSourcesForParameters is |
InvalidModelStateResponseFactory |
Delegate invoked on actions annotated with ApiControllerAttribute to convert invalid ModelStateDictionary into an IActionResult |
SuppressConsumesConstraintForFormFileParameters |
Gets or sets a value that determines if an |
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) and are registered in the DI Container (IServiceCollection) are assumed to be bound from the services Services, unless this option is explicitly disabled DisableImplicitFromServicesParameters. 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 |
Gets or sets a value that determines if controllers with ApiControllerAttribute transform certain client errors.
When 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 |
Gets or sets a value that determines if the filter that returns an BadRequestObjectResult when ModelState is invalid is suppressed. . |
SuppressUseValidationProblemDetailsForInvalidModelStateResponses |
Gets or sets a value that determines if controllers annotated with ApiControllerAttribute respond using ValidationProblemDetails in InvalidModelStateResponseFactory.
When |
Explicit Interface Implementations
IEnumerable.GetEnumerator() | |
IEnumerable<ICompatibilitySwitch>.GetEnumerator() |