src/Shared/EntityFramework/DataAnnotations/MinLengthAttribute.cs
/// <summary>
/// Determines whether a specified object is valid. (Overrides <see cref="ValidationAttribute.IsValid(object)" />)
/// </summary>
/// <remarks>
/// This method returns <c>true</c> if the <paramref name="value" /> is null.  
/// It is assumed the <see cref="RequiredAttribute" /> is used if the value may not be null.
/// </remarks>
/// <param name="value"> The object to validate. </param>
/// <returns> <c>true</c> if the value is null or greater than or equal to the specified minimum length, otherwise <c>false</c> </returns>
/// <exception cref="InvalidOperationException">Length is less than zero.</exception>
Determines whether a specified object is valid. (Overrides )
Determines whether a specified object is valid . ( Overrides )
public override bool IsValid(object value)
        {
            EnsureLegalLengths();
            if (value == null)
            {
                return true;
            }
            var str = value as string;
            var length = str != null ? str.Length : ((Array)value).Length;
            return length >= Length;
        }
public override bool IsValid ( object value ) { EnsureLegalLengths ( ) ; if ( value == null ) { return true ; } var str = value as string ; var length = str != null ? str . Length : ( ( Array ) value ) . Length ; return length >= Length ; }
Determines whether a specified object is valid.
Determines whether a specified object is valid .
// Check the lengths for legality // Automatically pass if value is null. RequiredAttribute should be used to assert a value is not null. // We expect a cast exception if a non-{string|array} property was passed in.
None
Length is less than zero.
Length is less than zero .
value
object
The object to validate.
The object to validate .
remarks
This method returns true is null.
It is assumed the  is used if the value may not be null.
This method returns true is null . It is assumed the is used if the value may not be null .