/// <summary> /// Synchronously invokes the rule. /// </summary> /// <returns> /// List of <see cref="System.ComponentModel.DataAnnotations.ValidationResult"/> if the rule fails execution. /// </returns> /// <param name="businessRule">A rule that implements <see cref="ISynchronousRule"/>.</param> public static IEnumerable <ValidationResult> Validate(this ISynchronousRule businessRule) { return(IRuleExtensions.ValidateAll(new [] { businessRule }, null)); }
/// <summary> /// Synchronously invokes the rules. /// </summary> /// <returns> /// List of <see cref="System.ComponentModel.DataAnnotations.ValidationResult"/> for any failed rules. /// </returns> /// <param name="businessRules">An enumerable list of <see cref="ISynchronousRule"/> to execute.</param> public static IEnumerable <ValidationResult> ValidateAll(this IEnumerable <ISynchronousRule> businessRules) { return(IRuleExtensions.ValidateAll(businessRules, null)); }