ValidationContext ValidationContext ValidationContext ValidationContext Constructors

Definition

Overloads

ValidationContext(Object) ValidationContext(Object) ValidationContext(Object) ValidationContext(Object)

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

ValidationContext(Object, IDictionary<Object,Object>) ValidationContext(Object, IDictionary<Object,Object>) ValidationContext(Object, IDictionary<Object,Object>) ValidationContext(Object, IDictionary<Object,Object>)

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

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

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

ValidationContext(Object) ValidationContext(Object) ValidationContext(Object) ValidationContext(Object)

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

public:
 ValidationContext(System::Object ^ instance);
public ValidationContext (object instance);
new System.ComponentModel.DataAnnotations.ValidationContext : obj -> System.ComponentModel.DataAnnotations.ValidationContext
Public Sub New (instance As Object)
Parameters
instance
Object Object Object Object

The object instance to validate. It cannot be null.

ValidationContext(Object, IDictionary<Object,Object>) ValidationContext(Object, IDictionary<Object,Object>) ValidationContext(Object, IDictionary<Object,Object>) ValidationContext(Object, IDictionary<Object,Object>)

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

public:
 ValidationContext(System::Object ^ instance, System::Collections::Generic::IDictionary<System::Object ^, System::Object ^> ^ items);
public ValidationContext (object instance, System.Collections.Generic.IDictionary<object,object> items);
new System.ComponentModel.DataAnnotations.ValidationContext : obj * System.Collections.Generic.IDictionary<obj, obj> -> System.ComponentModel.DataAnnotations.ValidationContext
Public Sub New (instance As Object, items As IDictionary(Of Object, Object))
Parameters
instance
Object Object Object Object

The object instance to validate. It cannot be null

items
IDictionary<Object,Object>

An optional set of key/value pairs to make available to consumers.

Remarks

If items is null, an empty dictionary is created. If items is not null, the set of key/value pairs is copied into a new dictionary, preventing consumers from modifying the original dictionary.

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

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

public:
 ValidationContext(System::Object ^ instance, IServiceProvider ^ serviceProvider, System::Collections::Generic::IDictionary<System::Object ^, System::Object ^> ^ items);
public ValidationContext (object instance, IServiceProvider serviceProvider, System.Collections.Generic.IDictionary<object,object> items);
new System.ComponentModel.DataAnnotations.ValidationContext : obj * IServiceProvider * System.Collections.Generic.IDictionary<obj, obj> -> System.ComponentModel.DataAnnotations.ValidationContext
Public Sub New (instance As Object, serviceProvider As IServiceProvider, items As IDictionary(Of Object, Object))
Parameters
instance
Object Object Object Object

The object to validate. This parameter is required.

serviceProvider
IServiceProvider IServiceProvider IServiceProvider IServiceProvider

The object that implements the IServiceProvider interface. This parameter is optional.

items
IDictionary<Object,Object>

A dictionary of key/value pairs to make available to the service consumers. This parameter is optional.

Remarks

The serviceProvider parameter represents a service that can be used by the GetService method in order to perform custom validation.

If the items parameter is null, an empty dictionary is created. If the parameter is not null, the set of key/value pairs is copied into a new dictionary, which prevents the service consumers from modifying the original dictionary.

Applies to