Esempio n. 1
0
 public static void ValidateMany <T>(IEnumerable <T> items, params Rule <T>[] rules)
 {
     using (var scope = ScopeFactory.ForValidation(typeof(T).Name, WhenAny))
     {
         scope.ValidateInScope(items, rules);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Creates scope that runs full check and then fails with
 /// <see cref="RuleException"/>, if the resulting
 /// <see cref="RuleLevel"/>  matches the <paramref name="predicate"/>
 /// </summary>
 /// <param name="name">The name for the scope.</param>
 /// <param name="predicate">The predicate.</param>
 /// <returns>new scope instance</returns>
 public static IScope ForValidation(string name, Predicate <RuleLevel> predicate)
 {
     return(ScopeFactory.ForValidation(name, predicate));
 }