Path: redb-route/redb.Route/Expressions/ExpressionValues.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/Expressions/ExpressionValues.cs
----
using System;
using System.Collections.Generic;
using System.Linq;
using redb.Route.Abstractions;
namespace redb.Route.Expressions;
///
/// Adapters that let an stand where an EIP asks for a delegate.
///
///
/// Six EIPs — Aggregate, RecipientList, DynamicRouter, IdempotentConsumer, Enrich and PollEnrich —
/// were typed on alone, so a route author who wanted a correlation
/// key out of an XML body had to write the wrapper by hand:
/// e => XPath("/order/id").Evaluate<string>(e). Wrapping is not the problem; writing
/// it once per call site is, because each hand-rolled wrapper decides on its own what an expression
/// that matched nothing means. These adapters make that decision once, in one place, so every EIP
/// answers the same way — and so a language added later inherits the answer instead of restating it.
///
internal static class ExpressionValues
{
internal const string DefaultUriDelimiter = ",";
///
/// Resolves what a query language should read: the message body by default, or whatever the
/// route named as the source.
///
///
/// Kept here rather than in each language so that a language added later inherits the rule
/// instead of restating it. Camel spells the source as a string prefix on each language
/// (header:payload); an ordinary expression is better, because a typo in
/// header.payloadd is then a parse the route can check rather than a string nobody read.
///
internal static object? ReadInput(IExpression? source, IExchange exchange)
=> source is null ? exchange.In.getBody