private static ValidationErrors ValidateObject(MyType obj)
        {
            ValidationErrorsBuilder e = default(ValidationErrorsBuilder);

            e.Add(BasicValidators.NotNull(obj.F3).Nest("f3"));
            e.Add(BasicValidators.NotNull(obj.F4).Nest("f4"));
            e.Add(Validators.CustomValidator(obj));
            if ((object)obj.F4 != null)
            {
                e.Add(Validators.CustomValidator(obj.F4).Nest("f4"));
            }
            if ((object)obj.F1 != null)
            {
                e.Add(Validators.CustomValidator(obj.F1).Nest("f1"));
            }
            if (obj.F2 != null)
            {
                e.Add(Validators.MySpecialStringValidator(0, obj.F2).Nest("f2"));
            }
            if (obj.F3 != null)
            {
                e.Add(Validators.MySpecialStringValidator(12, obj.F3).Nest("f3"));
            }
            return(e.Build());
        }
Esempio n. 2
0
        private static ValidationErrors ValidateObject(Scalar123 obj)
        {
            ValidationErrorsBuilder e = default(ValidationErrorsBuilder);

            e.Add(BasicValidators.NotNull(obj.Value).Nest("value"));
            ValidateObjectExtension(ref e, obj);
            return(e.Build());
        }
        private static ValidationErrors ValidateObject(A obj)
        {
            ValidationErrorsBuilder e = default(ValidationErrorsBuilder);

            e.Add(BasicValidators.NotNull(obj.PropA).Nest("propA"));
            e.Add(BasicValidators.NotNull(obj.PropAX).Nest("propAX"));
            return(e.Build());
        }
Esempio n. 4
0
        private static ValidationErrors ValidateObject(Test123 obj)
        {
            ValidationErrorsBuilder e = default(ValidationErrorsBuilder);

            e.Add(BasicValidators.NotEmpty(obj.Field543).Nest("Field543"));
            e.Add(BasicValidators.Range(1, 10, obj.AbcSS).Nest("abcSS"));
            return(e.Build());
        }
        private static ValidationErrors ValidateObject(CustomValidatorTest obj)
        {
            ValidationErrorsBuilder e = default(ValidationErrorsBuilder);

            e.Add(BasicValidators.NotNull(obj.F1).Nest("f1"));
            if (obj.F1 != null)
            {
                e.Add(Validators.MySpecialStringValidator(0, obj.F1).Nest("f1"));
            }
            return(e.Build());
        }
        private static ValidationErrors ValidateObject(Composite123 obj)
        {
            ValidationErrorsBuilder e = default(ValidationErrorsBuilder);

            e.Add(BasicValidators.NotNull(obj.Field543).Nest("Field543"));
            if (obj.Field543 != null)
            {
                e.Add(Validators.MySpecialStringValidator(0, obj.Field543).Nest("Field543"));
            }
            e.Add(BasicValidators.Range(1, 10, obj.AbcSS).Nest("abcSS"));
            ValidateObjectExtension(ref e, obj);
            return(e.Build());
        }