ModelStateDictionary.SetModelValue 方法

定義

多載

SetModelValue(String, ValueProviderResult)

ModelStateEntry使用指定的 key 設定 的值。

SetModelValue(String, Object, String)

使用指定的 設定 的 RawValueAttemptedValueModelStateEntrykey

SetModelValue(String, ValueProviderResult)

ModelStateEntry使用指定的 key 設定 的值。

public:
 void SetModelValue(System::String ^ key, Microsoft::AspNetCore::Mvc::ModelBinding::ValueProviderResult valueProviderResult);
public void SetModelValue (string key, Microsoft.AspNetCore.Mvc.ModelBinding.ValueProviderResult valueProviderResult);
member this.SetModelValue : string * Microsoft.AspNetCore.Mvc.ModelBinding.ValueProviderResult -> unit
Public Sub SetModelValue (key As String, valueProviderResult As ValueProviderResult)

參數

key
String

專案的索引鍵 ModelStateEntry

valueProviderResult
ValueProviderResult

ValueProviderResult具有專案資料的 ModelStateEntry

適用於

SetModelValue(String, Object, String)

使用指定的 設定 的 RawValueAttemptedValueModelStateEntrykey

public:
 void SetModelValue(System::String ^ key, System::Object ^ rawValue, System::String ^ attemptedValue);
public void SetModelValue (string key, object rawValue, string attemptedValue);
public void SetModelValue (string key, object? rawValue, string attemptedValue);
public void SetModelValue (string key, object? rawValue, string? attemptedValue);
member this.SetModelValue : string * obj * string -> unit
Public Sub SetModelValue (key As String, rawValue As Object, attemptedValue As String)

參數

key
String

專案的索引鍵 ModelStateEntry

rawValue
Object

專案的原始值 ModelStateEntry

attemptedValue
String

以逗號分隔 String 的 中的 值 rawValue

適用於