Path: redb-route/redb.Route/Definitions/SortDefinition.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/Definitions/SortDefinition.cs
----
using System.Collections;
using System.Globalization;
using redb.Route.Abstractions;
using redb.Route.Core;
using redb.Route.Processors;
namespace redb.Route.Definitions;
///
/// Sorts a collection taken from the exchange and puts the sorted list back into the body
/// (Camel sort()). The optional key selector is evaluated per element; in the string form
/// (Sort("body.items", "body.priority")) the key expression sees the element as body.
/// Numbers compare numerically across CLR types, strings ordinally, null first.
///
public sealed class SortDefinition : ProcessorDefinition
{
private readonly Func _source;
private readonly Func