public void ValidateMinLength()

in Darabonba/Validator.cs [66:85]


        public void ValidateMinLength(object obj)
        {
            bool result = true;
            if (Attribute != null && Attribute.MinLength > 0)
            {
                if (typeof(IList).IsAssignableFrom(obj.GetType()))
                {
                    result = ((IList)obj).Count >= Attribute.MinLength;
                }
                else
                {
                    result = obj.ToString().Length >= Attribute.MinLength;
                }
            }

            if (!result)
            {
                throw new ArgumentException(string.Format("{0} is less than min-length: {1}", PropertyName, Attribute.MinLength));
            }
        }