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

.NET Framework (current version)

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

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

public ValidationContext(
	object instance,
	IDictionary<object, object> items


Type: System.Object

The object instance to validate. It cannot be null

Type: System.Collections.Generic.IDictionary<Object, Object>

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

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.

Universal Windows Platform
Available since 8
.NET Framework
Available since 4.5
Portable Class Library
Supported in: portable .NET platforms
Return to top