public static Pred <T> AnyTrue <T>(this IEnumerable <Pred <T> > predicates, bool shortCircuit = true) { if (predicates == null) { throw new ArgumentNullException(nameof(predicates)); } return(Pred <T> .Any(predicates.Select(p => p.Func), shortCircuit)); }
public static Func <T, bool> AnyTrue <T>(this IEnumerable <Func <T, bool> > predicates, bool shortCircuit = true) { if (predicates == null) { throw new ArgumentNullException(nameof(predicates)); } return(Pred <T> .Any(predicates, shortCircuit)); }
public static Predicate <T> Or <T>(this Predicate <T> predicate, Pred <T> other, bool shortCircuit = true) { if (predicate == null) { throw new ArgumentNullException(nameof(predicate)); } if (other == null) { throw new ArgumentNullException(nameof(other)); } return(new Pred <T>(x => predicate(x)).Or(other, shortCircuit)); }
public static Func <T, bool> And <T>(this Func <T, bool> predicate, Pred <T> other, bool shortCircuit = true) { if (predicate == null) { throw new ArgumentNullException(nameof(predicate)); } if (other == null) { throw new ArgumentNullException(nameof(other)); } return(new Pred <T>(predicate).And(other, shortCircuit)); }