Exemplo n.º 1
0
 public override IEnumerable <ValidationRuleBase> GetSectionValidationRules(string sectionIdentifier)
 {
     if (ObjectType.GetProperty(sectionIdentifier) != null)
     {
         return
             (ObjectRecordService.GetValidatorAttributes(sectionIdentifier, ObjectType.AssemblyQualifiedName)
              .Select(va => new PropertyAttributeValidationRule(va)));
     }
     else
     {
         return(new ValidationRuleBase[0]);
     }
 }
Exemplo n.º 2
0
        public override IEnumerable <ValidationRuleBase> GetValidationRules(string fieldName, string recordType)
        {
            var validators    = new List <ValidationRuleBase>();
            var type          = ObjectRecordService.GetPropertyType(fieldName, ObjectType.AssemblyQualifiedName);
            var isValidatable = type.IsTypeOf(typeof(IValidatableObject));

            if (isValidatable)
            {
                validators.Add(new IValidatableObjectValidationRule());
            }
            validators.AddRange(ObjectRecordService.GetValidatorAttributes(fieldName, ObjectType.AssemblyQualifiedName)
                                .Select(va => new PropertyAttributeValidationRule(va)));
            return(validators);
        }
Exemplo n.º 3
0
 public override IEnumerable <ValidationRuleBase> GetSubgridValidationRules(string fieldName, string subGridRecordType)
 {
     return(ObjectRecordService.GetValidatorAttributes(fieldName, subGridRecordType)
            .Select(va => new PropertyAttributeValidationRule(va)));
 }