Path: redb-route/redb.Route/Definitions/SetPropertyDefinition.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/SetPropertyDefinition.cs ---- using redb.Route.Abstractions; using redb.Route.Core; using redb.Route.Processors; namespace redb.Route.Definitions; /// /// Leaf definition that sets an exchange property to a static value. /// public sealed class SetPropertyStaticDefinition : ProcessorDefinition { private readonly string _key; private readonly object? _value; /// Creates a set-property definition with a static value. public SetPropertyStaticDefinition(string key, object? value) { ArgumentException.ThrowIfNullOrWhiteSpace(key); _key = key; _value = value; } /// public override IProcessor CreateProcessor(IRouteContext context) => new DelegateProcessor(exchange => exchange.Properties[_key] = _value); } /// /// Leaf definition that sets an exchange property using a factory function. /// public sealed class SetPropertyFactoryDefinition : ProcessorDefinition { private readonly string _key; private readonly Func _factory; /// Creates a set-property definition using a factory. public SetPropertyFactoryDefinition(string key, Func factory) { ArgumentException.ThrowIfNullOrWhiteSpace(key); ArgumentNullException.ThrowIfNull(factory); _key = key; _factory = factory; } /// public override IProcessor CreateProcessor(IRouteContext context) => new DelegateProcessor(exchange => exchange.Properties[_key] = _factory(exchange)); } /// /// Leaf definition that sets an exchange property using an . /// public sealed class SetPropertyExpressionDefinition : ProcessorDefinition { private readonly string _key; private readonly IExpression _expression; /// Creates a set-property definition from an expression. public SetPropertyExpressionDefinition(string key, IExpression expression) { ArgumentException.ThrowIfNullOrWhiteSpace(key); ArgumentNullException.ThrowIfNull(expression); _key = key; _expression = expression; } /// public override IProcessor CreateProcessor(IRouteContext context) => new ExpressionPropertyProcessor(_key, _expression); } /// /// Leaf definition that removes a property from the exchange. /// public sealed class RemovePropertyDefinition : ProcessorDefinition { private readonly string _key; /// Creates a remove-property definition. public RemovePropertyDefinition(string key) { ArgumentException.ThrowIfNullOrWhiteSpace(key); _key = key; } /// public override IProcessor CreateProcessor(IRouteContext context) => new DelegateProcessor(exchange => exchange.Properties.Remove(_key)); }