ModelStateDictionary.SetModelValue 方法

定義

多載

SetModelValue(String, ValueProviderResult)

使用指定的設定的值 ModelStateEntry key

SetModelValue(String, Object, String)

使用指定的,設定的 RawValue 和的 AttemptedValue ModelStateEntry key

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)

使用指定的,設定的 RawValue 和的 AttemptedValue ModelStateEntry key

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

的值( rawValue 以逗號分隔) String

適用於