IModelBindingMessageProvider Interface¶
Provider for error messages the model binding system detects.
- Namespace
Microsoft.AspNetCore.Mvc.ModelBinding.Metadata
- Assemblies
- Microsoft.AspNetCore.Mvc.Abstractions
Syntax¶
public interface IModelBindingMessageProvider
-
interface
Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.
IModelBindingMessageProvider
Properties¶
-
Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.IModelBindingMessageProvider.
AttemptedValueIsInvalidAccessor
¶ Error message the model binding system adds when
Microsoft.AspNetCore.Mvc.ModelBinding.ModelError.Exception
is of typeSystem.FormatException
orSystem.OverflowException
and value is known.Return type: System.Func<System.String> Returns: Default System.String
is “The value ‘{0}’ is not valid for {1}.”.Func<string, string, string> AttemptedValueIsInvalidAccessor { get; }
-
Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.IModelBindingMessageProvider.
MissingBindRequiredValueAccessor
¶ Error message the model binding system adds when a property with an associated <code>BindRequiredAttribute</code> is not bound.
Return type: System.Func<System.String> Returns: Default System.String
is “A value for the ‘{0}’ property was not provided.”.Func<string, string> MissingBindRequiredValueAccessor { get; }
-
Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.IModelBindingMessageProvider.
MissingKeyOrValueAccessor
¶ Error message the model binding system adds when either the key or the value of a
System.Collections.Generic.KeyValuePair`2
is bound but not both.Return type: System.Func<System.String> Returns: Default System.String
is “A value is required.”.Func<string> MissingKeyOrValueAccessor { get; }
-
Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.IModelBindingMessageProvider.
UnknownValueIsInvalidAccessor
¶ Error message the model binding system adds when
Microsoft.AspNetCore.Mvc.ModelBinding.ModelError.Exception
is of typeSystem.FormatException
orSystem.OverflowException
and value is unknown.Return type: System.Func<System.String> Returns: Default System.String
is “The supplied value is invalid for {0}.”.Func<string, string> UnknownValueIsInvalidAccessor { get; }
-
Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.IModelBindingMessageProvider.
ValueIsInvalidAccessor
¶ Fallback error message HTML and tag helpers display when a property is invalid but the
Microsoft.AspNetCore.Mvc.ModelBinding.ModelError
s have <code>null</code>Microsoft.AspNetCore.Mvc.ModelBinding.ModelError.ErrorMessage
s.Return type: System.Func<System.String> Returns: Default System.String
is “The value ‘{0}’ is invalid.”.Func<string, string> ValueIsInvalidAccessor { get; }
-
Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.IModelBindingMessageProvider.
ValueMustBeANumberAccessor
¶ Error message HTML and tag helpers add for client-side validation of numeric formats. Visible in the browser if the field for a <code>float</code> property (for example) does not have a correctly-formatted value.
Return type: System.Func<System.String> Returns: Default System.String
is “The field {0} must be a number.”.Func<string, string> ValueMustBeANumberAccessor { get; }
-
Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.IModelBindingMessageProvider.
ValueMustNotBeNullAccessor
¶ Error message the model binding system adds when a <code>null</code> value is bound to a non-
System.Nullable
property.Return type: System.Func<System.String> Returns: Default System.String
is “The value ‘{0}’ is invalid.”.Func<string, string> ValueMustNotBeNullAccessor { get; }
-