Exemple #1
0
        public static BoolMessage Validate(IValidator validator)
        {
            IValidationResults validationResults = validator.Validate();

            if (validationResults.IsValid)
            {
                return(new BoolMessage(true, string.Empty));
            }
            string message = validationResults.Message();

            return(new BoolMessage(false, message));
        }
Exemple #2
0
        /// <summary>
        /// Validates the rule and returns a boolMessage.
        /// </summary>
        /// <param name="validator"></param>
        /// <returns></returns>
        public static BoolMessage Validate(IValidator validator)
        {
            IValidationResults results = validator.Validate() as IValidationResults;

            // Empty message if Successful.
            if (results.IsValid)
            {
                return(new BoolMessage(true, string.Empty));
            }

            // Error
            string multiLineError = results.Message();

            return(new BoolMessage(false, multiLineError));
        }