ModelValidationNode 类

定义

为模型验证信息提供容器。Provides a container for model validation information.

public ref class ModelValidationNode sealed
public sealed class ModelValidationNode
type ModelValidationNode = class
Public NotInheritable Class ModelValidationNode
继承
ModelValidationNode

构造函数

ModelValidationNode(ModelMetadata, String)

使用指定的模式元数据和状态密钥来初始化 ModelValidationNode 类的新实例。Initializes a new instance of the ModelValidationNode class, using the model metadata and state key.

ModelValidationNode(ModelMetadata, String, IEnumerable<ModelValidationNode>)

用模型元数据、模型状态键和模型验证子节点初始化 ModelValidationNode 类的新实例。Initializes a new instance of the ModelValidationNode class, using the model metadata, the model state key, and child model-validation nodes.

属性

ChildNodes

获取子节点。Gets the child nodes.

ModelMetadata

获取模型元数据。Gets the model metadata.

ModelStateKey

获取模型状态键。Gets the model state key.

SuppressValidation

获取或设置一个值,该值指示是否应显示验证。Gets or sets a value that indicates whether validation should be suppressed.

ValidateAllProperties

获取或设置一个值,该值指示是否应在验证模型的所有属性。Gets or sets a value that indicates whether all properties of the model should be validated.

方法

CombineWith(ModelValidationNode)

将当前的 ModelValidationNode 实例与指定的 ModelValidationNode 实例合并起来。Combines the current ModelValidationNode instance with a specified ModelValidationNode instance.

Equals(Object)

确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)
Validate(ModelBindingExecutionContext)

使用指定的执行上下文,确认该模型。Validates the model using the specified execution context.

Validate(ModelBindingExecutionContext, ModelValidationNode)

使用指定的执行上下文和父节点,确认该模型。Validates the model using the specified execution context and parent node.

事件

Validated

当模型已被验证时发生。Occurs when the model has been validated.

Validating

当模型正被验证时发生。Occurs when the model is being validated.

适用于