コード例 #1
0
        public void Modify(ElementRequest request)
        {
            var rules = request.ValidatorRules();

            var maximumLengthValidator = rules.Get <IMaximumLengthValidator>();

            if (maximumLengthValidator != null)
            {
                request.CurrentTag.MaxLength(maximumLengthValidator.Max);
            }

            if ((request.Accessor.PropertyType.IsAnyOf <DateTime, DateTime?>()) &&
                request.Accessor.InnerProperty.HasAttribute <DateOnlyAttribute>())
            {
                request.CurrentTag.MaxLength(10);
            }
        }