ComplexObject.ValidateProperty Method (ValidationContext, Object)

WCF RIA Services

[WCF RIA Services Version 1 Service Pack 2 is compatible with either .NET framework 4 or .NET Framework 4.5, and with either Silverlight 4 or Silverlight 5.]

Validates whether the specified property value is valid for a specified ValidationContext.

Namespace:  System.ServiceModel.DomainServices.Client
Assembly:  System.ServiceModel.DomainServices.Client (in System.ServiceModel.DomainServices.Client.dll)

protected virtual void ValidateProperty(
	ValidationContext validationContext,
	Object value
)

Parameters

validationContext
Type: System.ComponentModel.DataAnnotations.ValidationContext
The ValidationContext representing the validation to be performed
value
Type: System.Object
The value to test. It may be null if null is valid for the specified property.

ExceptionCondition
ArgumentNullException

validationContext is null.

This method evaluates the ValidationAttribute associated with the property indicated as the MemberName, accumulating the validation errors and surfacing them through the ValidationErrors property.

This method also verifies that the property is not read-only.

All validation logic is bypassed if this instance is currently being deserialized.

Show: