Exemple #1
0
        /// <summary>
        /// Validates the command.
        /// </summary>
        /// <param name="command">The command to validate.</param>
        /// <returns>An enumeration of validation results.</returns>
        public IEnumerable <ValidationResult> Validate(IValidatableObject command)
        {
            if (command.IsNull())
            {
                return(null);
            }

            var validationResult = new List <ValidationResult>();

            Validator.TryValidateObject(command, new ValidationContext(command, null, null), validationResult, true);

            return(validationResult);
        }