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 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 Predicate <T> AllTrue <T>(this IEnumerable <Predicate <T> > predicates, bool shortCircuit = true) { if (predicates == null) { throw new ArgumentNullException("predicates"); } return(Pred <T> .All(predicates.Select(AsFunc), 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> Or <T>(this Func <T, bool> predicate, Pred <T> other, bool shortCircuit = true) { if (predicate == null) { throw new ArgumentNullException("predicate"); } if (other == null) { throw new ArgumentNullException("other"); } return(new Pred <T>(predicate).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)); }
public static Predicate <T> And <T>(this Predicate <T> predicate, Pred <T> other, bool shortCircuit = true) { if (predicate == null) { throw new ArgumentNullException("predicate"); } if (other == null) { throw new ArgumentNullException("other"); } return(new Pred <T>(x => predicate(x)).And(other, shortCircuit)); }