ModelStateDictionary.IsValidField(String) 方法
定义
确定是否存在与指定键关联或以指定键为前缀的任何 ModelError 对象。Determines whether there are any ModelError objects that are associated with the specified key or that are prefixed with the specified key.
public:
bool IsValidField(System::String ^ key);
public bool IsValidField (string key);
member this.IsValidField : string -> bool
Public Function IsValidField (key As String) As Boolean
参数
- key
- String
键。The key.
返回
如果与指定键关联或以指定键为前缀的任何 ModelError 对象,则为 true,否则为 false。true if any ModelError objects are associated with the specified key or prefixed with the specified key; otherwise, false. 如果在字典中未找到键,则此方法将返回 true。If the key is not found in the dictionary, this method returns true.
例外
key 参数为 null。The key parameter is null.