Export (0) Print
Expand All

MaxLengthAttribute Class

Specifies the maximum length of array or string data allowed in a property.

System::Object
  System::Attribute
    System.ComponentModel.DataAnnotations::ValidationAttribute
      System.ComponentModel.DataAnnotations::MaxLengthAttribute

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

[AttributeUsageAttribute(AttributeTargets::Property|AttributeTargets::Field|AttributeTargets::Parameter, AllowMultiple = false)]
public ref class MaxLengthAttribute : public ValidationAttribute

The MaxLengthAttribute type exposes the following members.

  NameDescription
Public methodMaxLengthAttribute() Initializes a new instance of the MaxLengthAttribute class. The maximum allowable length supported by the database will be used.
Public methodMaxLengthAttribute(Int32) Initializes a new instance of the MaxLengthAttribute class.
Top

  NameDescription
Public propertyErrorMessage (Inherited from ValidationAttribute.)
Public propertyErrorMessageResourceName (Inherited from ValidationAttribute.)
Public propertyErrorMessageResourceType (Inherited from ValidationAttribute.)
Protected propertyErrorMessageString (Inherited from ValidationAttribute.)
Public propertyLength Gets the maximum allowable length of the array/string data.
Public propertyRequiresValidationContext (Inherited from ValidationAttribute.)
Public propertyTypeId (Inherited from Attribute.)
Top

  NameDescription
Public methodEquals (Inherited from Attribute.)
Protected methodFinalize (Inherited from Object.)
Public methodFormatErrorMessage Applies formatting to a specified error message. (Overrides <see cref="M:System.ComponentModel.DataAnnotations.ValidationAttribute.FormatErrorMessage(System.String)" />) (Overrides ValidationAttribute::FormatErrorMessage(String).)
Public methodGetHashCode (Inherited from Attribute.)
Public methodGetType (Inherited from Object.)
Public methodGetValidationResult (Inherited from ValidationAttribute.)
Public methodIsDefaultAttribute (Inherited from Attribute.)
Public methodIsValid(Object) Determines whether a specified object is valid. (Overrides <see cref="M:System.ComponentModel.DataAnnotations.ValidationAttribute.IsValid(System.Object)" />) (Overrides ValidationAttribute::IsValid(Object).)
Protected methodIsValid(Object, ValidationContext) (Inherited from ValidationAttribute.)
Public methodMatch (Inherited from Attribute.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Public methodValidate(Object, String) (Inherited from ValidationAttribute.)
Public methodValidate(Object, ValidationContext) (Inherited from ValidationAttribute.)
Top

  NameDescription
Explicit interface implemetationPrivate method_Attribute::GetIDsOfNames (Inherited from Attribute.)
Explicit interface implemetationPrivate method_Attribute::GetTypeInfo (Inherited from Attribute.)
Explicit interface implemetationPrivate method_Attribute::GetTypeInfoCount (Inherited from Attribute.)
Explicit interface implemetationPrivate method_Attribute::Invoke (Inherited from Attribute.)
Top

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