ModelStateDictionary.SetModelValue Method

Definition

Overloads

SetModelValue(String, ValueProviderResult)

Sets the value for the ModelStateEntry with the specified key.

SetModelValue(String, Object, String)

Sets the of RawValue and AttemptedValue for the ModelStateEntry with the specified key.

SetModelValue(String, ValueProviderResult)

Source:
ModelStateDictionary.cs
Source:
ModelStateDictionary.cs
Source:
ModelStateDictionary.cs

Sets the value for the ModelStateEntry with the specified key.

C#
public void SetModelValue (string key, Microsoft.AspNetCore.Mvc.ModelBinding.ValueProviderResult valueProviderResult);

Parameters

key
String

The key for the ModelStateEntry entry

valueProviderResult
ValueProviderResult

A ValueProviderResult with data for the ModelStateEntry entry.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

SetModelValue(String, Object, String)

Source:
ModelStateDictionary.cs
Source:
ModelStateDictionary.cs
Source:
ModelStateDictionary.cs

Sets the of RawValue and AttemptedValue for the ModelStateEntry with the specified key.

C#
public void SetModelValue (string key, object rawValue, string attemptedValue);
C#
public void SetModelValue (string key, object? rawValue, string attemptedValue);
C#
public void SetModelValue (string key, object? rawValue, string? attemptedValue);

Parameters

key
String

The key for the ModelStateEntry entry.

rawValue
Object

The raw value for the ModelStateEntry entry.

attemptedValue
String

The values of rawValue in a comma-separated String.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0