ModelStateDictionary.GetValidationState(String) 方法

定義

傳回的 ModelValidationState key

public:
 Microsoft::AspNetCore::Mvc::ModelBinding::ModelValidationState GetValidationState(System::String ^ key);
public Microsoft.AspNetCore.Mvc.ModelBinding.ModelValidationState GetValidationState (string key);
member this.GetValidationState : string -> Microsoft.AspNetCore.Mvc.ModelBinding.ModelValidationState
Public Function GetValidationState (key As String) As ModelValidationState

參數

key
String

要查詢模型狀態錯誤的索引鍵。

傳回

ModelValidationState

如果找 Unvalidated 不到指定索引鍵的專案,則為, Invalid 如果找不到具有一或多個模型狀態錯誤的實例則為, Valid 否則為。

適用於