Exemple #1
0
        /* Validation */

        public void Validate(Object validationObject)
        {
            ICollection<ValidationResult> validationResults;
            if (!validationObject.Validate(out validationResults))
            {
                ValidationResult[] validationException = new ValidationResult[1];
                validationResults.CopyTo(validationException, 0);
                var ex = new ValidationException(validationException[0].ErrorMessage);
                throw ex;
            }
        }