ModelStateDictionary 类
本文内容
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
表示尝试将 HTTP 请求中的值绑定到操作方法的状态,其中包括验证信息。
public ref class ModelStateDictionary : System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<System::String ^, Microsoft::AspNetCore::Mvc::ModelBinding::ModelStateEntry ^>>, System::Collections::Generic::IReadOnlyCollection<System::Collections::Generic::KeyValuePair<System::String ^, Microsoft::AspNetCore::Mvc::ModelBinding::ModelStateEntry ^>>, System::Collections::Generic::IReadOnlyDictionary<System::String ^, Microsoft::AspNetCore::Mvc::ModelBinding::ModelStateEntry ^>
public class ModelStateDictionary : System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry>>, System.Collections.Generic.IReadOnlyCollection<System.Collections.Generic.KeyValuePair<string,Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry>>, System.Collections.Generic.IReadOnlyDictionary<string,Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry>
type ModelStateDictionary = class
interface IReadOnlyDictionary<string, ModelStateEntry>
interface seq<KeyValuePair<string, ModelStateEntry>>
interface IEnumerable
interface IReadOnlyCollection<KeyValuePair<string, ModelStateEntry>>
type ModelStateDictionary = class
interface seq<KeyValuePair<string, ModelStateEntry>>
interface IEnumerable
interface IReadOnlyCollection<KeyValuePair<string, ModelStateEntry>>
interface IReadOnlyDictionary<string, ModelStateEntry>
Public Class ModelStateDictionary
Implements IEnumerable(Of KeyValuePair(Of String, ModelStateEntry)), IReadOnlyCollection(Of KeyValuePair(Of String, ModelStateEntry)), IReadOnlyDictionary(Of String, ModelStateEntry)
- 继承
-
ModelStateDictionary
- 实现
构造函数
Model |
初始化 ModelStateDictionary 类的新实例。 |
Model |
初始化 ModelStateDictionary 类的新实例。 |
Model |
使用从指定的 |
字段
属性
Count |
表示尝试将 HTTP 请求中的值绑定到操作方法的状态,其中包括验证信息。 |
Error |
通过 AddModelError 或 TryAddModelError获取添加到此 实例ModelStateDictionary的错误数。 |
Has |
获取一个值,该值指示是否记录了最大错误数。 |
Is |
获取一个值,该值指示此模型状态字典中的任何模型状态值是否无效或未验证。 |
Item[String] |
表示尝试将 HTTP 请求中的值绑定到操作方法的状态,其中包括验证信息。 |
Keys |
获取键序列。 |
Max |
获取或设置此 实例 ModelStateDictionary中允许的最大模型状态错误。
默认为 |
Root |
的 ModelStateDictionary根条目。 |
Validation |
表示尝试将 HTTP 请求中的值绑定到操作方法的状态,其中包括验证信息。 |
Values |
获取值序列。 |
方法
显式接口实现
IEnumerable. |
表示尝试将 HTTP 请求中的值绑定到操作方法的状态,其中包括验证信息。 |
IEnumerable<Key |
表示尝试将 HTTP 请求中的值绑定到操作方法的状态,其中包括验证信息。 |
IRead |
表示尝试将 HTTP 请求中的值绑定到操作方法的状态,其中包括验证信息。 |
IRead |
表示尝试将 HTTP 请求中的值绑定到操作方法的状态,其中包括验证信息。 |
扩展方法
Add |
将指定的 |
Add |
将指定的 |
Remove<TModel>(Model |
从 |
Remove |
从 ModelStateDictionary中移除指定 |
Try |
将指定的 |