ModelStateEntry Class

An entry in a Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary.

Namespace
Microsoft.AspNetCore.Mvc.ModelBinding
Assemblies
  • Microsoft.AspNetCore.Mvc.Abstractions

Syntax

public abstract class ModelStateEntry
class Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry

Properties

Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry.AttemptedValue

Gets the set of values contained in Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry.RawValue, joined into a comma-separated string.

Return type:System.String
public string AttemptedValue { get; set; }
Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry.Children

Gets the Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry values for sub-properties.

Return type:System.Collections.Generic.IReadOnlyList<Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry>
public abstract IReadOnlyList<ModelStateEntry> Children { get; }
Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry.Errors

Gets the Microsoft.AspNetCore.Mvc.ModelBinding.ModelErrorCollection for this entry.

Return type:Microsoft.AspNetCore.Mvc.ModelBinding.ModelErrorCollection
public ModelErrorCollection Errors { get; }
Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry.IsContainerNode

Gets a value that determines if the current instance of Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry is a container node. Container nodes represent prefix nodes that aren’t explicitly added to the Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary.

Return type:System.Boolean
public abstract bool IsContainerNode { get; }
Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry.RawValue

Gets the raw value from the request associated with this entry.

Return type:System.Object
public object RawValue { get; set; }
Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry.ValidationState

Gets or sets the Microsoft.AspNetCore.Mvc.ModelBinding.ModelValidationState for this entry.

Return type:Microsoft.AspNetCore.Mvc.ModelBinding.ModelValidationState
public ModelValidationState ValidationState { get; set; }

Methods

GetModelStateForProperty(System.String)

Gets the Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry for a sub-property with the specified <em>propertyName</em>.

Arguments:propertyName (System.String) – The property name to lookup.
Return type:Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry
Returns:The Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry if a sub-property was found; otherwise <code>null</code>.
public abstract ModelStateEntry GetModelStateForProperty(string propertyName)