Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​ComponentModel.​DataAnnotations.​ValidationContext

Assembly: System.ComponentModel.Annotations

Inheritance: object → ValidationContext

Implemented Interfaces

Describes the context in which a validation check is performed.

Properties

public string
DisplayName
Gets or sets the name of the member to validate.
public Collections.​Generic.​IDictionary<​object, object>
Items
Gets the dictionary of key/value pairs that is associated with this context.
public string
MemberName
Gets or sets the name of the member to validate.
public object
ObjectInstance
Gets the object to validate.
public Type
ObjectType
Gets the type of the object to validate.

Methods

public object
GetService​(Type serviceType)
Returns the service that provides custom validation.
Returns An instance of the service, or <see langword="null" /> if the service is not available.
serviceType The type of the service to use for validation.
public void
InitializeServiceProvider​(Func<​Type, object> serviceProvider)
Initializes the <see cref="T:System.ComponentModel.DataAnnotations.ValidationContext" /> using a service provider that can return service instances by type when <see cref="M:System.Web.Mvc.IDependencyResolver.GetService(System.Type)" /> is called.
serviceProvider The service provider.
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object