Class PredicateValidator
Validator that checks an against the exchange. The predicate is
awaited through when the processor validates
asynchronously, so a predicate that consults a store or a service does not block. A plain
delegate is wrapped in a at the boundary.
public sealed class PredicateValidator : IMessageValidator
Inheritance
Implements
Methods
Validate(IExchange)
Validates the exchange and returns a result indicating success or failure with error details.
public ValidationResult Validate(IExchange exchange)
ValidateAsync(IExchange)
Validates the exchange asynchronously. The default forwards to ;
public Task<ValidationResult> ValidateAsync(IExchange exchange)
Constructors
PredicateValidator(Func<IExchange, bool>, Func<IExchange, string>)
Creates a validator from a delegate and an error factory.
PredicateValidator(Func<IExchange, bool>, string)
Creates a validator from a delegate and a fixed error message.
PredicateValidator(IPredicate, Func<IExchange, string>)
Creates a validator from a predicate instance and an error factory.
PredicateValidator(IPredicate, string)
Creates a validator from a predicate instance and a fixed error message.