Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
DataAnnotationsModelValidatorProvider Class
Collapse the table of content
Expand the table of content

DataAnnotationsModelValidatorProvider Class

.NET Framework 4.6 and 4.5

Implements the default validator provider.

Namespace:  System.Web.ModelBinding
Assembly:  System.Web (in System.Web.dll)

public class DataAnnotationsModelValidatorProvider : AssociatedValidatorProvider

The DataAnnotationsModelValidatorProvider type exposes the following members.

  NameDescription
Public methodDataAnnotationsModelValidatorProviderInitializes a new instance of the DataAnnotationsModelValidatorProvider class.
Top

  NameDescription
Public propertyStatic memberAddImplicitRequiredAttributeForValueTypesGets or sets a value that indicates whether non-nullable value types are required.
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodGetTypeDescriptorGets a type descriptor for the specified type. (Inherited from AssociatedValidatorProvider.)
Public methodGetValidators(ModelMetadata, ModelBindingExecutionContext)Gets the validators for the model using the specified metadata and execution context. (Inherited from AssociatedValidatorProvider.)
Protected methodGetValidators(ModelMetadata, ModelBindingExecutionContext, IEnumerable<Attribute>)Gets a collection of validators for the model. (Overrides AssociatedValidatorProvider.GetValidators(ModelMetadata, ModelBindingExecutionContext, IEnumerable<Attribute>).)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodStatic memberRegisterAdapterRegisters an adapter for client-side validation.
Public methodStatic memberRegisterAdapterFactoryRegisters an adapter factory for the validation provider.
Public methodStatic memberRegisterDefaultAdapterRegisters the default adapter.
Public methodStatic memberRegisterDefaultAdapterFactoryRegisters the default adapter factory.
Public methodStatic memberRegisterDefaultValidatableObjectAdapterRegisters an adapter for default object validation.
Public methodStatic memberRegisterDefaultValidatableObjectAdapterFactoryRegisters an adapter factory for the default object validation provider.
Public methodStatic memberRegisterValidatableObjectAdapterRegisters an adapter for object validation.
Public methodStatic memberRegisterValidatableObjectAdapterFactoryRegisters an adapter factory for the object validation provider.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

This class is an implementation of ModelValidatorProvider that provides validators for attributes that derive from ValidationAttribute. It also provides validators for types that implement IValidatableObject.

.NET Framework

Supported in: 4.6, 4.5

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