Interface IConditionSource
Declarative capture of the condition a scope was built from, for definitions whose behaviour is
driven by a condition: Filter and the When branch of a Choice.
The DSL offers three ways to write a condition, and this contract keeps one name and one fixed
type for each of them, so a reader never has to guess what a property holds:
— the condition was written as a predicate instance,
or was compiled from a condition string into one. — the condition was written as an expression
instance. — the condition string exactly as the author wrote it.
A condition written as a plain delegate leaves all three null: a lambda has no source to
capture. A condition written as a string sets and, since it is
compiled into one, .
Only reading is offered. The properties are filled while the route is being built and are not
meant to be rewritten afterwards.
public interface IConditionSource
Properties
SourceExpression
The expression instance the condition was built from; null if there is none.
IExpression? SourceExpression { get; }
SourcePredicate
The predicate the condition was built from, or built into; null if there is none.
IPredicate? SourcePredicate { get; }
SourceTemplate
The condition string as the author wrote it; null if the condition was not written as a string.
string? SourceTemplate { get; }