Method FromExpression(IExpression)

Assembly: redb.Route.dll

Builds a predicate from an expression instance used in a condition position.

An expression born from a string (Expr("header.amount>1000")) is a condition
string that happened to be wrapped, so it takes the same path as
: compiled as a condition, whitespace-insensitive, fail-fast.
Reading it as a value first would resurrect the original silent-drop defect: the value
dialect turned the unspaced comparison into a lookup of a header named
amount>1000, which never exists.


An expression that implements answers the condition itself.
A query language brings its own notion of a match that evaluating-then-reading-truthiness
cannot reconstruct: XPath("/order/discount") in a condition asks whether the path
matched, and flattening the node-set to a value first would answer with the node's content
instead — <discount>0</discount> would read as "no match". Asking the
expression keeps that decision where the language's semantics live.


Any other expression is evaluated and read through .

public static IPredicate FromExpression(IExpression expression)