Compartilhar via


ComplexObject.ValidateProperty Method (ValidationContext, Object)

[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)

Syntax

'Declaration
Protected Overridable Sub ValidateProperty ( _
    validationContext As ValidationContext, _
    value As Object _
)
'Usage
Dim validationContext As ValidationContext
Dim value As Object

Me.ValidateProperty(validationContext, _
    value)
protected virtual void ValidateProperty(
    ValidationContext validationContext,
    Object value
)
protected:
virtual void ValidateProperty(
    ValidationContext^ validationContext, 
    Object^ value
)
abstract ValidateProperty : 
        validationContext:ValidationContext * 
        value:Object -> unit 
override ValidateProperty : 
        validationContext:ValidationContext * 
        value:Object -> unit 
protected function ValidateProperty(
    validationContext : ValidationContext, 
    value : Object
)

Parameters

  • value
    Type: System.Object
    The value to test. It may be nulla null reference (Nothing in Visual Basic) if nulla null reference (Nothing in Visual Basic) is valid for the specified property.

Exceptions

Exception Condition
ArgumentNullException

validationContext is nulla null reference (Nothing in Visual Basic).

Remarks

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.

See Also

Reference

ComplexObject Class

ValidateProperty Overload

System.ServiceModel.DomainServices.Client Namespace