MvcOptions MvcOptions MvcOptions Class


Provides programmatic configuration for the MVC framework.

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)


MvcOptions() MvcOptions() MvcOptions()

Creates a new instance of MvcOptions.


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

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

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

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

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

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

Conventions Conventions Conventions

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

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

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

FormatterMappings FormatterMappings FormatterMappings

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

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

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

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

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.

This property is associated with a compatibility switch and can provide a different behavior depending on the configured compatibility version for the application. See CompatibilityVersion for guidance and examples of setting the application's compatibility version.

Configuring the desired value of the compatibility switch by calling this property's setter will take precedence over the value implied by the application's CompatibilityVersion.

If the application's compatibility version is set to Version_2_2 then this setting will have the value 200 unless explicitly configured.

If the application's compatibility version is set to Version_2_1 or earlier then this setting will have the value null unless explicitly configured.

ModelBinderProviders ModelBinderProviders ModelBinderProviders

Gets a list of IModelBinderProviders used by this application.

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

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

ModelValidatorProviders ModelValidatorProviders ModelValidatorProviders

Gets a list of IModelValidatorProviders used by this application.

OutputFormatters OutputFormatters OutputFormatters

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

RequireHttpsPermanent RequireHttpsPermanent RequireHttpsPermanent

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

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

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

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.

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.

SuppressInputFormatterBuffering SuppressInputFormatterBuffering SuppressInputFormatterBuffering

Gets or sets the flag to buffer the request body in input formatters. Default is false.

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.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator()

Applies to