Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

DefaultModelBindingMessageProvider Class

Definition

Namespace:
Microsoft.AspNetCore.Mvc.ModelBinding.Metadata
Assembly:
Microsoft.AspNetCore.Mvc.Core.dll
Package:
Microsoft.AspNetCore.App.Ref v10.0.0
Package:
Microsoft.AspNetCore.App.Ref v11.0.0-preview.4.26230.115
Package:
Microsoft.AspNetCore.Mvc.Core v2.0.0
Package:
Microsoft.AspNetCore.Mvc.Core v2.1.0
Package:
Microsoft.AspNetCore.Mvc.Core v2.2.0
Package:
Microsoft.AspNetCore.App.Ref v3.0.1
Package:
Microsoft.AspNetCore.App.Ref v3.1.10
Package:
Microsoft.AspNetCore.App.Ref v5.0.0
Package:
Microsoft.AspNetCore.App.Ref v6.0.36
Package:
Microsoft.AspNetCore.App.Ref v7.0.5
Package:
Microsoft.AspNetCore.App.Ref v8.0.19
Package:
Microsoft.AspNetCore.App.Ref v9.0.8
Source:
DefaultModelBindingMessageProvider.cs
Source:
DefaultModelBindingMessageProvider.cs
Source:
DefaultModelBindingMessageProvider.cs

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.

Read / write ModelBindingMessageProvider implementation.

public ref class DefaultModelBindingMessageProvider : Microsoft::AspNetCore::Mvc::ModelBinding::Metadata::ModelBindingMessageProvider
public class DefaultModelBindingMessageProvider : Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.ModelBindingMessageProvider
type DefaultModelBindingMessageProvider = class
 inherit ModelBindingMessageProvider
Public Class DefaultModelBindingMessageProvider
Inherits ModelBindingMessageProvider
Inheritance
DefaultModelBindingMessageProvider

Constructors

Name Description
DefaultModelBindingMessageProvider()

Initializes a new instance of the DefaultModelBindingMessageProvider class.

DefaultModelBindingMessageProvider(DefaultModelBindingMessageProvider)

Initializes a new instance of the DefaultModelBindingMessageProvider class based on originalProvider.

Properties

Name Description
AttemptedValueIsInvalidAccessor

Error message the model binding system adds when Exception is of type FormatException or OverflowException, value is known, and error is associated with a property.

MissingBindRequiredValueAccessor

Error message the model binding system adds when a property with an associated BindRequiredAttribute is not bound.

MissingKeyOrValueAccessor

Error message the model binding system adds when either the key or the value of a KeyValuePair<TKey,TValue> is bound but not both.

MissingRequestBodyRequiredValueAccessor

Error message the model binding system adds when no value is provided for the request body, but a value is required.

NonPropertyAttemptedValueIsInvalidAccessor

Error message the model binding system adds when Exception is of type FormatException or OverflowException, value is known, and error is associated with a collection element or parameter.

NonPropertyUnknownValueIsInvalidAccessor

Error message the model binding system adds when Exception is of type FormatException or OverflowException, value is unknown, and error is associated with a collection element or parameter.

NonPropertyValueMustBeANumberAccessor

Error message HTML and tag helpers add for client-side validation of numeric formats. Visible in the browser if the field for a float (for example) collection element or action parameter does not have a correctly-formatted value.

UnknownValueIsInvalidAccessor

Error message the model binding system adds when Exception is of type FormatException or OverflowException, value is unknown, and error is associated with a property.

ValueIsInvalidAccessor

Fallback error message HTML and tag helpers display when a property is invalid but the ModelErrors have nullErrorMessages.

ValueMustBeANumberAccessor

Error message HTML and tag helpers add for client-side validation of numeric formats. Visible in the browser if the field for a float (for example) property does not have a correctly-formatted value.

ValueMustNotBeNullAccessor

Error message the model binding system adds when a null value is bound to a non-Nullable property.

Methods

Name Description
SetAttemptedValueIsInvalidAccessor(Func<String,String,String>)

Sets the AttemptedValueIsInvalidAccessor property.

SetMissingBindRequiredValueAccessor(Func<String,String>)

Sets the MissingBindRequiredValueAccessor property.

SetMissingKeyOrValueAccessor(Func<String>)

Sets the MissingKeyOrValueAccessor property.

SetMissingRequestBodyRequiredValueAccessor(Func<String>)

Sets the MissingRequestBodyRequiredValueAccessor property.

SetNonPropertyAttemptedValueIsInvalidAccessor(Func<String,String>)

Sets the NonPropertyAttemptedValueIsInvalidAccessor property.

SetNonPropertyUnknownValueIsInvalidAccessor(Func<String>)

Sets the NonPropertyUnknownValueIsInvalidAccessor property.

SetNonPropertyValueMustBeANumberAccessor(Func<String>)

Sets the NonPropertyValueMustBeANumberAccessor property.

SetUnknownValueIsInvalidAccessor(Func<String,String>)

Sets the UnknownValueIsInvalidAccessor property.

SetValueIsInvalidAccessor(Func<String,String>)

Sets the ValueIsInvalidAccessor property.

SetValueMustBeANumberAccessor(Func<String,String>)

Sets the ValueMustBeANumberAccessor property.

SetValueMustNotBeNullAccessor(Func<String,String>)

Sets the ValueMustNotBeNullAccessor property.

Applies to


Feedback

Was this page helpful?