Class WhenDefinition

Assembly: redb.Route.dll

A single When branch inside a .
Inherits the leaf DSL from ; close with
, , or .

public class WhenDefinition : RouteDefinitionBase<WhenDefinition>, IRouteDefinition, IProcessorDefinition, IRouteScope, ICompositeScope, IConditionSource

Inheritance

Implements

Inherited Members

Properties

SourceExpression

The expression instance the condition was built from; null if there is none.

public IExpression? SourceExpression { get; }

SourcePredicate

The predicate the condition was built from, or built into; null if there is none.

public IPredicate? SourcePredicate { get; }

SourceTemplate

The condition string as the author wrote it; null if the condition was not written as a string.

public string? SourceTemplate { get; }

Methods

CreateProcessor(IRouteContext)

Compile this node into a runtime processor.

public override IProcessor CreateProcessor(IRouteContext context)

End()

Closes this scope and returns the parent .

public IRouteDefinition End()

EndChoice()

Closes the entire Choice scope and returns the parent route definition.

public IRouteDefinition EndChoice()

EndWhen()

Closes this When branch and returns the parent choice.

public ChoiceDefinition EndWhen()

Otherwise()

Opens the Otherwise fallback branch on the parent choice.

public OtherwiseDefinition Otherwise()

When(Func<IExchange, bool>)

Opens another When branch on the parent choice.

public WhenDefinition When(Func<IExchange, bool> predicate)

When(IExpression)

Opens another When branch with an expression predicate.

public WhenDefinition When(IExpression expression)

When(IPredicate)

Opens another When branch guarded by an .

public WhenDefinition When(IPredicate predicate)