FluxFlow.Components.Mapping 3.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package FluxFlow.Components.Mapping --version 3.0.0
                    
NuGet\Install-Package FluxFlow.Components.Mapping -Version 3.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FluxFlow.Components.Mapping" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FluxFlow.Components.Mapping" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="FluxFlow.Components.Mapping" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FluxFlow.Components.Mapping --version 3.0.0
                    
#r "nuget: FluxFlow.Components.Mapping, 3.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package FluxFlow.Components.Mapping@3.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FluxFlow.Components.Mapping&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=FluxFlow.Components.Mapping&version=3.0.0
                    
Install as a Cake Tool

FluxFlow.Components.Mapping

A standalone mapper node for FluxFlow. It depends only on FluxFlow.Nodes and FluxFlow.Mapping — no engine, registry, or runtime. You new the node and LinkTo the next one.

Node

Node Shape Purpose
FlowMapperNode<TInput, TOutput> Input → Output, Failed Maps each message with a host-provided expression engine.

Every message travels as a FlowMessage<T> envelope. The mapped result is broadcast on Output as FlowMessage<TOutput>, carrying the same correlation id as the input. When a mapping throws, the original input is fanned to Failed (as FlowMessage<TInput>, same correlation id) and a FlowError surfaces on Errors; the node keeps processing later messages.

The package does not choose an expression language. Applications provide an IFlowExpressionEngine (from FluxFlow.Mapping); the node compiles the mapping expression once at construction and evaluates the compiled form per message.

var options = new MapperOptions
{
    Expression = "...",
    ExpressionName = "normalize-message",
    InputType = "app.input",
    OutputType = "app.output"
};

await using var node = new FlowMapperNode<AppInput, AppOutput>(
    options,
    appExpressionEngine,
    contextFactory: new TypedMappingContextFactory<AppInput>(new AppInputContextFactory()));

node.Output.LinkTo(resultSink, new DataflowLinkOptions { PropagateCompletion = false });
node.Failed.LinkTo(deadLetterSink, new DataflowLinkOptions { PropagateCompletion = false });

await node.Input.SendAsync(FlowMessage.Create(appInput));

TInput and TOutput are the real CLR types the node maps between. MapperOptions carries the descriptive metadata (InputType, OutputType/targetType, ExpressionId, ExpressionName) used in diagnostics and error context, plus the Expression itself and the input BoundedCapacity.

Mapping context

By default the node exposes the message payload as the input and value variables on the per-message FlowMapContext. Pass an IMappingContextFactory (for example a TypedMappingContextFactory<TInput> wrapping an IFlowMapContextFactory<TInput> from FluxFlow.Mapping) to control the variables each expression evaluates against:

var node = new FlowMapperNode<AppInput, AppOutput>(
    options,
    appExpressionEngine,
    contextFactory: new TypedMappingContextFactory<AppInput>(new AppInputContextFactory()));

Behavior

Mapping failures emit a FlowError on Errors (carrying the input's correlation id and MappingErrorCodes.MapperFailed), fan the original input to Failed, and the node keeps processing later messages. A compiled-mapper path that returns a wrong-typed or null value surfaces a clearer "incompatible or null value" message naming the expected output type. Per-message flow.mapper.succeeded / flow.mapper.failed events flow on the Events port with input type, output type, engine name, and the expression id/name when supplied.

Runtime timing

Diagnostics use the node's clock for Timestamp (default TimeProvider.System). Provide a deterministic clock for tests:

new FlowMapperNode<AppInput, AppOutput>(options, engine, clock: new FakeTimeProvider(timestamp));
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on FluxFlow.Components.Mapping:

Package Downloads
FluxFlow.Components.Mapping.Composition

Optional FluxFlow.Composition adapter for typed and schema-less JSON mapping with value-or-error outputs.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
7.0.0-rc.1 92 9/5/2026
6.0.0 173 8/3/2026
3.0.2 136 7/3/2026
3.0.1 179 7/2/2026
3.0.0 120 6/19/2026
2.0.0 137 6/18/2026
1.3.0 125 6/15/2026
1.2.0 423 6/12/2026
1.1.0 125 6/5/2026
1.0.0 127 6/4/2026
0.2.0-alpha.1 249 6/2/2026
0.1.1-alpha.1 85 6/2/2026
0.1.0-alpha.1 132 5/31/2026

Rebuilt as a single standalone flow.mapper node over the FluxFlow.Nodes kit: input in, mapped result broadcast out, the original input fanned to the Failed port when a mapping throws, failures on the error port — all carrying the message correlation id, diagnostics on the event port. The mapping expression is compiled once at construction via a host-provided IFlowExpressionEngine. The engine factory, module, registration extensions, component types/ports, design-metadata provider, definition-options reader, and the expression-engine/type/context-factory registry layer are removed; the node takes its options, expression engine, optional context factory, and TimeProvider directly and depends only on FluxFlow.Nodes and FluxFlow.Mapping (runs without the engine).