Path: redb-route/redb.Route/Predicates/InPredicate.cs Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/redb.Route/Predicates/InPredicate.cs ---- using redb.Route.Abstractions; namespace redb.Route.Predicates; /// /// Predicate that checks whether an expression result is contained in a specified set of values. /// public class InPredicate : IPredicate { private readonly IExpression _expression; private readonly HashSet _values; /// /// Initializes a new instance with the specified expression and allowed values. /// /// The expression to evaluate. /// The set of values to check membership against. public InPredicate(IExpression expression, params object[] values) { _expression = expression; _values = new HashSet(values); } /// public bool Matches(IExchange exchange) { var result = _expression.Evaluate(exchange); return _values.Contains(result); } /// public Task MatchesAsync(IExchange exchange) => Task.FromResult(Matches(exchange)); }