ValidationContext Class

 

Describes the context in which a validation check is performed.

Namespace:   System.ComponentModel.DataAnnotations
Assembly:  System.ComponentModel.DataAnnotations (in System.ComponentModel.DataAnnotations.dll)

System.Object
  System.ComponentModel.DataAnnotations.ValidationContext

public sealed class ValidationContext : IServiceProvider

NameDescription
System_CAPS_pubmethodValidationContext(Object)

Initializes a new instance of the ValidationContext class using the specified object instance

System_CAPS_pubmethodValidationContext(Object, IDictionary<Object, Object>)

Initializes a new instance of the ValidationContext class using the specified object and an optional property bag.

System_CAPS_pubmethodValidationContext(Object, IServiceProvider, IDictionary<Object, Object>)

Initializes a new instance of the ValidationContext class using the service provider and dictionary of service consumers.

NameDescription
System_CAPS_pubpropertyDisplayName

Gets or sets the name of the member to validate.

System_CAPS_pubpropertyItems

Gets the dictionary of key/value pairs that is associated with this context.

System_CAPS_pubpropertyMemberName

Gets or sets the name of the member to validate.

System_CAPS_pubpropertyObjectInstance

Gets the object to validate.

System_CAPS_pubpropertyObjectType

Gets the type of the object to validate.

System_CAPS_pubpropertyServiceContainer

Gets the validation services container.

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetService(Type)

Returns the service that provides custom validation.

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodInitializeServiceProvider(Func<Type, Object>)

Initializes the ValidationContext using a service provider that can return service instances by type when GetService is called.

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

This class describes the type or member on which validation is performed. It also enables custom validation to be added through any service that implements the IServiceProvider interface.

Universal Windows Platform
Available since 8
.NET Framework
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 3.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: