예제 #1
0
 /// <summary>
 /// Asynchronously 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="IRule"/>.</param>
 public static Task <IEnumerable <ValidationResult> > ValidateAsync(this IRule businessRule)
 {
     return(IRuleExtensions.ValidateAllAsync(businessRule.ToArray(), null));
 }
예제 #2
0
 /// <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));
 }
예제 #3
0
 /// <summary>
 /// Asynchronously 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="IRule"/> to execute.</param>
 public static Task <IEnumerable <ValidationResult> > ValidateAllAsync(this IEnumerable <IRule> businessRules)
 {
     return(IRuleExtensions.ValidateAllAsync(businessRules, null));
 }
예제 #4
0
 /// <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));
 }