MvcOptions Class

Provides programmatic configuration for the MVC framework.

Namespace
Microsoft.AspNetCore.Mvc
Assemblies
  • Microsoft.AspNetCore.Mvc.Core

Syntax

public class MvcOptions
class Microsoft.AspNetCore.Mvc.MvcOptions

Constructors

MvcOptions()
public MvcOptions()

Properties

Microsoft.AspNetCore.Mvc.MvcOptions.CacheProfiles

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

Return type:System.Collections.Generic.IDictionary<System.String>
public IDictionary<string, CacheProfile> CacheProfiles { get; }
Microsoft.AspNetCore.Mvc.MvcOptions.Conventions

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

Return type:System.Collections.Generic.IList<Microsoft.AspNetCore.Mvc.ApplicationModels.IApplicationModelConvention>
public IList<IApplicationModelConvention> Conventions { get; }
Microsoft.AspNetCore.Mvc.MvcOptions.Filters

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

Return type:Microsoft.AspNetCore.Mvc.Filters.FilterCollection
public FilterCollection Filters { get; }
Microsoft.AspNetCore.Mvc.MvcOptions.FormatterMappings

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

Return type:Microsoft.AspNetCore.Mvc.Formatters.FormatterMappings
public FormatterMappings FormatterMappings { get; }
Microsoft.AspNetCore.Mvc.MvcOptions.InputFormatters

Gets a list of Microsoft.AspNetCore.Mvc.Formatters.IInputFormatters that are used by this application.

Return type:Microsoft.AspNetCore.Mvc.Formatters.FormatterCollection<Microsoft.AspNetCore.Mvc.Formatters.IInputFormatter>
public FormatterCollection<IInputFormatter> InputFormatters { get; }
Microsoft.AspNetCore.Mvc.MvcOptions.MaxModelValidationErrors

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

Return type:System.Int32
public int MaxModelValidationErrors { get; set; }
Microsoft.AspNetCore.Mvc.MvcOptions.ModelBinderProviders

Gets a list of Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinderProviders used by this application.

Return type:System.Collections.Generic.IList<Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinderProvider>
public IList<IModelBinderProvider> ModelBinderProviders { get; }
Microsoft.AspNetCore.Mvc.MvcOptions.ModelBindingMessageProvider

Gets the default Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.IModelBindingMessageProvider. Changes here are copied to the Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata.ModelBindingMessageProvider property of all Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata instances unless overridden in a custom Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.IBindingMetadataProvider.

Return type:Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.ModelBindingMessageProvider
public ModelBindingMessageProvider ModelBindingMessageProvider { get; }
Microsoft.AspNetCore.Mvc.MvcOptions.ModelMetadataDetailsProviders

Gets a list of Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.IMetadataDetailsProvider instances that will be used to create Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata instances.

Return type:System.Collections.Generic.IList<Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.IMetadataDetailsProvider>
public IList<IMetadataDetailsProvider> ModelMetadataDetailsProviders { get; }
Microsoft.AspNetCore.Mvc.MvcOptions.ModelValidatorProviders

Gets a list of Microsoft.AspNetCore.Mvc.ModelBinding.Validation.IModelValidatorProviders used by this application.

Return type:System.Collections.Generic.IList<Microsoft.AspNetCore.Mvc.ModelBinding.Validation.IModelValidatorProvider>
public IList<IModelValidatorProvider> ModelValidatorProviders { get; }
Microsoft.AspNetCore.Mvc.MvcOptions.OutputFormatters

Gets a list of Microsoft.AspNetCore.Mvc.Formatters.IOutputFormatters that are used by this application.

Return type:Microsoft.AspNetCore.Mvc.Formatters.FormatterCollection<Microsoft.AspNetCore.Mvc.Formatters.IOutputFormatter>
public FormatterCollection<IOutputFormatter> OutputFormatters { get; }
Microsoft.AspNetCore.Mvc.MvcOptions.RespectBrowserAcceptHeader

Gets or sets the flag which causes content negotiation to ignore Accept header when it contains the media type /. <xref uid=”langword_csharp_false” name=”false” href=”“></xref> by default.

Return type:System.Boolean
public bool RespectBrowserAcceptHeader { get; set; }
Microsoft.AspNetCore.Mvc.MvcOptions.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. <xref uid=”langword_csharp_false” name=”false” href=”“></xref> by default.

Return type:System.Boolean
public bool ReturnHttpNotAcceptable { get; set; }
Microsoft.AspNetCore.Mvc.MvcOptions.SslPort

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

Return type:System.Nullable<System.Int32>
public int ? SslPort { get; set; }
Microsoft.AspNetCore.Mvc.MvcOptions.ValueProviderFactories

Gets a list of Microsoft.AspNetCore.Mvc.ModelBinding.IValueProviderFactory used by this application.

Return type:System.Collections.Generic.IList<Microsoft.AspNetCore.Mvc.ModelBinding.IValueProviderFactory>
public IList<IValueProviderFactory> ValueProviderFactories { get; }