Breeze.ContextProvider.BreezeMetadataValidator.MaxLengthValidator.Validate C# (CSharp) Method

Validate() private method

private Validate ( object value ) : string
value object
return string
      internal override string Validate(object value) {
        if (maxLength < 0) {
          maxLength = Convert.ToInt32(properties["maxLength"]);
          if (maxLength < 0) throw new Exception("Validator maxLength must be >= 0");
        }
        var s = value as string;
        if (s == null) return null;
        if (s.Length > maxLength) {
          return "String length must not exceed " + maxLength;
        }
        return null;
      }
    }
BreezeMetadataValidator.MaxLengthValidator