Example #1
0
        public IEnumerable <ValidationResult> TryValidateFullobject(IValidatableObject value)
        {
            var validationResults = new List <ValidationResult>();

            Validator.TryValidateObject(value, new ValidationContext(value), validationResults, true);
            return(validationResults);
        }
Example #2
0
        public static List <ValidationResult> TryValidate(IValidatableObject value)
        {
            var context = new ValidationContext(value);
            var errors  = new List <ValidationResult>();

            Validator.TryValidateObject(value, context, errors, true);

            return(errors);
        }
Example #3
0
        public static IEnumerable <ValidationResult> TryValidateObject(IValidatableObject value)
        {
            var results = new List <ValidationResult> ();
            var context = new ValidationContext(value);

            Validator.TryValidateObject(value, context, results);

            foreach (var result in results)
            {
                yield return(result);
            }
        }
Example #4
0
        public ICharacterRoster()
        {
            var character = new IValidatableObject()
            {
                CharacterName   = "",
                Profession      = "",
                Race            = "",
                Description     = "",
                Attributes      = 50,
                CharacterRoster = "",
            };

            Add(character, out var error);
        }
Example #5
0
 public void ValidateFullObject(IValidatableObject value)
 {
     Validator.ValidateObject(value, new ValidationContext(value), true);
 }
Example #6
0
        public static void Validate(IValidatableObject value)
        {
            var context = new ValidationContext(value);

            Validator.ValidateObject(value, context, true);
        }
Example #7
0
 public void Validate(IValidatableObject value)
 {
     Validator.ValidateObject(value, new ValidationContext(value));
 }
Example #8
0
 private void Add(IValidatableObject character, out string error)
 {
     throw new NotImplementedException();
 }