MvcOptions MvcOptions MvcOptions MvcOptions Class

Definition

Provides programmatic configuration for the MVC framework.

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

Constructors

MvcOptions() MvcOptions() MvcOptions() MvcOptions()

Creates a new instance of MvcOptions.

Properties

AllowBindingHeaderValuesToNonStringModelTypes AllowBindingHeaderValuesToNonStringModelTypes AllowBindingHeaderValuesToNonStringModelTypes AllowBindingHeaderValuesToNonStringModelTypes

Gets or sets a value that determines if HeaderModelBinder should bind to types other than String or a collection of String. If set to true, HeaderModelBinder would bind to simple types (like String, Int32, Enum, Boolean etc.) or a collection of simple types. The default value of the property is false.

AllowCombiningAuthorizeFilters AllowCombiningAuthorizeFilters AllowCombiningAuthorizeFilters AllowCombiningAuthorizeFilters

Gets or sets a value that determines if policies on instances of AuthorizeFilter will be combined into a single effective policy. The default value of the property is false.

AllowEmptyInputInBodyModelBinding AllowEmptyInputInBodyModelBinding AllowEmptyInputInBodyModelBinding AllowEmptyInputInBodyModelBinding

Gets or sets the flag which decides whether body model binding (for example, on an action method parameter with FromBodyAttribute) should treat empty input as valid. false by default.

AllowShortCircuitingValidationWhenNoValidatorsArePresent AllowShortCircuitingValidationWhenNoValidatorsArePresent AllowShortCircuitingValidationWhenNoValidatorsArePresent AllowShortCircuitingValidationWhenNoValidatorsArePresent

Gets or sets a value that determines if ValidationVisitor can short-circuit validation when a model does not have any associated validators.

AllowValidatingTopLevelNodes AllowValidatingTopLevelNodes AllowValidatingTopLevelNodes AllowValidatingTopLevelNodes

Gets or sets a value that determines if model bound action parameters, controller properties, page handler parameters, or page model properties are validated (in addition to validating their elements or properties). If set to true, BindRequiredAttribute and ValidationAttributes on these top-level nodes are checked. Otherwise, such attributes are ignored.

CacheProfiles CacheProfiles CacheProfiles CacheProfiles

Gets a Dictionary of CacheProfile Names, CacheProfile which are pre-defined settings for response caching.

Conventions Conventions Conventions Conventions

Gets a list of IApplicationModelConvention instances that will be applied to the ApplicationModel when discovering actions.

EnableEndpointRouting EnableEndpointRouting EnableEndpointRouting EnableEndpointRouting

Gets or sets a value that determines if routing should use endpoints internally, or if legacy routing logic should be used. Endpoint routing is used to match HTTP requests to MVC actions, and to generate URLs with IUrlHelper.

Filters Filters Filters Filters

Gets a collection of IFilterMetadata which are used to construct filters that apply to all actions.

FormatterMappings FormatterMappings FormatterMappings FormatterMappings

Used to specify mapping between the URL Format and corresponding media type.

InputFormatterExceptionPolicy InputFormatterExceptionPolicy InputFormatterExceptionPolicy InputFormatterExceptionPolicy

Gets or sets a value which determines how the model binding system interprets exceptions thrown by an IInputFormatter. The default value of the property is AllExceptions.

InputFormatters InputFormatters InputFormatters InputFormatters

Gets a list of IInputFormatters that are used by this application.

MaxIAsyncEnumerableBufferLimit MaxIAsyncEnumerableBufferLimit MaxIAsyncEnumerableBufferLimit MaxIAsyncEnumerableBufferLimit

Gets or sets the most number of entries of an IAsyncEnumerable<T> that that ObjectResultExecutor will buffer.

When Value is an instance of IAsyncEnumerable<T>, ObjectResultExecutor will eagerly read the enumeration and add to a synchronous collection prior to invoking the selected formatter. This property determines the most number of entries that the executor is allowed to buffer.

MaxModelBindingCollectionSize MaxModelBindingCollectionSize MaxModelBindingCollectionSize MaxModelBindingCollectionSize

Gets or sets the maximum size of a complex collection to model bind. When this limit is reached, the model binding system will throw an InvalidOperationException.

MaxModelBindingRecursionDepth MaxModelBindingRecursionDepth MaxModelBindingRecursionDepth MaxModelBindingRecursionDepth

Gets or sets the maximum recursion depth of the model binding system. The DefaultModelBindingContext will throw an InvalidOperationException if more than this number of IModelBinders are on the stack. That is, an attempt to recurse beyond this level will fail.

MaxModelValidationErrors MaxModelValidationErrors MaxModelValidationErrors MaxModelValidationErrors

Gets or sets the maximum number of validation errors that are allowed by this application before further errors are ignored.

MaxValidationDepth MaxValidationDepth MaxValidationDepth MaxValidationDepth

Gets or sets the maximum depth to constrain the validation visitor when validating. Set to null to disable this feature.

ValidationVisitor traverses the object graph of the model being validated. For models that are very deep or are infinitely recursive, validation may result in stack overflow.

When not null, ValidationVisitor will throw if traversing an object exceeds the maximum allowed validation depth.

ModelBinderProviders ModelBinderProviders ModelBinderProviders ModelBinderProviders

Gets a list of IModelBinderProviders used by this application.

ModelBindingMessageProvider ModelBindingMessageProvider ModelBindingMessageProvider ModelBindingMessageProvider

Gets the default ModelBindingMessageProvider. Changes here are copied to the ModelBindingMessageProvider property of all ModelMetadata instances unless overridden in a custom IBindingMetadataProvider.

ModelMetadataDetailsProviders ModelMetadataDetailsProviders ModelMetadataDetailsProviders ModelMetadataDetailsProviders

Gets a list of IMetadataDetailsProvider instances that will be used to create ModelMetadata instances.

ModelValidatorProviders ModelValidatorProviders ModelValidatorProviders ModelValidatorProviders

Gets a list of IModelValidatorProviders used by this application.

OutputFormatters OutputFormatters OutputFormatters OutputFormatters

Gets a list of IOutputFormatters that are used by this application.

RequireHttpsPermanent RequireHttpsPermanent RequireHttpsPermanent RequireHttpsPermanent

Gets or sets the default value for the Permanent property of RequireHttpsAttribute.

RespectBrowserAcceptHeader RespectBrowserAcceptHeader RespectBrowserAcceptHeader RespectBrowserAcceptHeader

Gets or sets the flag which causes content negotiation to ignore Accept header when it contains the media type /. false by default.

ReturnHttpNotAcceptable ReturnHttpNotAcceptable ReturnHttpNotAcceptable ReturnHttpNotAcceptable

Gets or sets the flag which decides whether an HTTP 406 Not Acceptable response will be returned if no formatter has been selected to format the response. false by default.

SslPort SslPort SslPort SslPort

Gets or sets the SSL port that is used by this application when RequireHttpsAttribute is used. If not set the port won't be specified in the secured URL e.g. https://localhost/path.

SuppressAsyncSuffixInActionNames SuppressAsyncSuffixInActionNames SuppressAsyncSuffixInActionNames SuppressAsyncSuffixInActionNames

Gets or sets a value that determines if MVC will remove the suffix "Async" applied to controller action names.

ActionName is used to construct the route to the action as well as in view lookup. When true, MVC will trim the suffix "Async" applied to action method names. For example, the action name for ProductsController.ListProductsAsync will be canonicalized as ListProducts.. Consequently, it will be routeable at /Products/ListProducts with views looked up at /Views/Products/ListProducts.cshtml.

This option does not affect values specified using using ActionNameAttribute.

SuppressBindingUndefinedValueToEnumType SuppressBindingUndefinedValueToEnumType SuppressBindingUndefinedValueToEnumType SuppressBindingUndefinedValueToEnumType

Gets or sets a value indicating whether the model binding system will bind undefined values to enum types. The default value of the property is false.

SuppressImplicitRequiredAttributeForNonNullableReferenceTypes SuppressImplicitRequiredAttributeForNonNullableReferenceTypes SuppressImplicitRequiredAttributeForNonNullableReferenceTypes SuppressImplicitRequiredAttributeForNonNullableReferenceTypes

Gets or sets a value that detemines if the inference of RequiredAttribute for for properties and parameters of non-nullable reference types is suppressed. If false (the default), then all non-nullable reference types will behave as-if [Required] has been applied. If true, this behavior will be suppressed; nullable reference types and non-nullable reference types will behave the same for the purposes of validation.

SuppressInputFormatterBuffering SuppressInputFormatterBuffering SuppressInputFormatterBuffering SuppressInputFormatterBuffering

Gets or sets a value that determines if buffering is disabled for input formatters that synchronously read from the HTTP request body.

SuppressOutputFormatterBuffering SuppressOutputFormatterBuffering SuppressOutputFormatterBuffering SuppressOutputFormatterBuffering

Gets or sets the flag that determines if buffering is disabled for output formatters that synchronously write to the HTTP response body.

ValidateComplexTypesIfChildValidationFails ValidateComplexTypesIfChildValidationFails ValidateComplexTypesIfChildValidationFails ValidateComplexTypesIfChildValidationFails

Gets or sets a value that determines whether the validation visitor will perform validation of a complex type if validation fails for any of its children.

ValueProviderFactories ValueProviderFactories ValueProviderFactories ValueProviderFactories

Gets a list of IValueProviderFactory used by this application.

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