System.ComponentModel.DataAnnotations 4.0.0.0 System.Attribute

This class enforces validation, based on the metadata that is associated with the data table. You can override this class to create custom validation attributes.

Serves as the base class for all validation attributes.

- Constructor
  4.0.0.0
  To be added.

  Initializes a new instance of the class.

- Constructor
  4.0.0.0

  This constructor provides a resource accessor function that is used by the property to retrieve an error message.

  Initializes a new instance of the class by using the function that enables access to validation resources.

  The function that enables access to validation resources.
- Constructor
  4.0.0.0
  To be added.

  Initializes a new instance of the class by using the error message to associate with a validation control.

  The error message to associate with a validation control.
- Property
  4.0.0.0
  System.String To be added.

  This property is the error message that you associate with the validation control. It is used for non-localized error messages.

  Gets or sets an error message to associate with a validation control if validation fails.

- Property
  4.0.0.0
  System.String To be added.

  You use the property together with the property in order to provide a localized error message.

  Gets or sets the error message resource name to use in order to look up the property value if validation fails.

- Property
  4.0.0.0
  System.Type To be added.

  You use the property together with the property in to provide a localized error message.

  Gets or sets the resource type to use for error-message lookup if validation fails.

- Property
  4.0.0.0
  System.String To be added.

  The error message string is obtained by evaluating the property or by evaluating the and properties. The two cases are mutually exclusive. The second case is used if you want to display a localized error message.

  Gets the localized validation error message.

- Method
  4.0.0.0
  System.String ``

  This method formats an error message by using the property. This method appends the name of the data field that triggered the error to the formatted error message. You can customize how the error message is formatted by creating a derived class that overrides this method.

  Applies formatting to an error message, based on the data field where the error occurred.

  An instance of the formatted error message.

  The name to include in the formatted message.
- Method
  4.0.0.0
  System.ComponentModel.DataAnnotations.ValidationResult `` ``

  The method checks validity without throwing an exception.

  Checks whether the specified value is valid with respect to the current validation attribute.

  An instance of the class.

  The value to validate. The context information about the validation operation.
- Method
  4.0.0.0
  System.Boolean ``

  If you inherit from the class, you must implement the validation logic in this method.

  Determines whether the specified value of the object is valid.

  true if the specified value is valid; otherwise, false.

  The value of the object to validate.
- Method
  4.0.0.0
  System.ComponentModel.DataAnnotations.ValidationResult `` `` To be added.

  Validates the specified value with respect to the current validation attribute.

  An instance of the class.

  The value to validate. The context information about the validation operation.
- Property
  4.0.0.0
  System.Boolean To be added. To be added.

  Gets a value that indicates whether the attribute requires validation context.

- Method
  4.0.0.0
  System.Void `` ``

  This method calls the method to determine whether the object that is specified by the parameter is valid. If the method returns false, this method calls the method to get a localized message that states the problem. It then throws a exception.

  Validates the specified object.

  The object to validate. The object that describes the context where the validation checks are performed. This parameter cannot be null.
- Method
  4.0.0.0
  System.Void `` ``

  This method validates the value of the object or property on which the attribute is declared. It calls the method and passes as a parameter. If validation fails, a exception is thrown.

  Validates the specified object.

  The value of the object to validate. The name to include in the error message.