Entity.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.]

Indicates whether the specified property value is valid for the specified validation context.

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. MemberName must indicate the name of the property to validate.
value
Type: System.Object
The value to test. It may be null if null is valid for the given property.

This method evaluates all of the ValidationAttribute objects associated with the property indicated as the MemberName, and throws a ValidationException for the first ValidationAttribute that signals a validation error.

Show: