Eternet.Mediator.Generator
3.1.56
Prefix Reserved
dotnet add package Eternet.Mediator.Generator --version 3.1.56
NuGet\Install-Package Eternet.Mediator.Generator -Version 3.1.56
<PackageReference Include="Eternet.Mediator.Generator" Version="3.1.56"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="Eternet.Mediator.Generator" Version="3.1.56" />
<PackageReference Include="Eternet.Mediator.Generator"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add Eternet.Mediator.Generator --version 3.1.56
#r "nuget: Eternet.Mediator.Generator, 3.1.56"
#:package Eternet.Mediator.Generator@3.1.56
#addin nuget:?package=Eternet.Mediator.Generator&version=3.1.56
#tool nuget:?package=Eternet.Mediator.Generator&version=3.1.56
Eternet.Mediator.Generator
Source generator package for production pipeline execution in Eternet.Mediator.
Installation
dotnet add package Eternet.Mediator.Generator
Use it as an analyzer/source-generator package in projects that generate mediator pipelines.
Runtime Ownership
Each assembly that declares [GenerateExecutePipeline<...>] must reference a pipeline generator so it can emit its own
pipeline executors and StepsResults partials. In multi-assembly hosts, only one assembly should own the concrete
mediator runtime (Mediator.Mediator, MediatorOptions, and AddMediator).
Prefer Eternet.Mediator.Pipeline.Generator for assemblies that need pipeline generation but should not own the
runtime:
dotnet add package Eternet.Mediator.Pipeline.Generator
It emits pipeline executors, StepsResults, and pipeline registration extensions only.
The host/runtime owner can then include the pipeline-only assembly in TargetAssemblies:
services.AddMediator(options =>
{
options.TargetAssemblies =
[
typeof(HostServiceRegistration).Assembly,
typeof(FeatureFromPipelineOnlyAssembly).Assembly
];
});
TargetAssemblies controls handler discovery for the generated runtime. It does not generate pipeline code for other
assemblies.
Step Execution Policies
[UseStepExecutionPolicy<TPolicy>] marks a step whose raw Handle(...) call is wrapped by a policy-managed input and
outcome flow while the generated executor keeps owning retry, exception recovery, duration measurement, publication, and
stateful resume.
Use it when the pipeline graph should keep the business step visible, but the app needs reusable per-step decisions such as skip rules, input construction, and mapping raw responses or failures to a domain outcome.
The step signature must expose exactly one domain input plus an optional CancellationToken:
[UseStepExecutionPolicy<RunExternalSyncPolicy>]
public sealed class RunExternalSyncAsync
{
public Task<ExternalSyncResponse> Handle(
ExternalSyncInput input,
CancellationToken cancellationToken)
{
return client.RunAsync(input, cancellationToken);
}
}
The policy implements the exact closed contract:
public sealed class RunExternalSyncPolicy
: IStepExecutionPolicy<
RunSynchronization.Request,
ExternalSyncInput,
ExternalSyncResponse,
ScheduledSynchronizationOutcome>
{
public ValueTask<StepExecutionInput<ExternalSyncInput>> BuildInputAsync(
RunSynchronization.Request request,
StepExecutionPolicyContext context,
CancellationToken cancellationToken)
{
return request.Options.Enabled
? ValueTask.FromResult(StepExecutionInput<ExternalSyncInput>.Execute(new(request.ExecutionId)))
: ValueTask.FromResult(StepExecutionInput<ExternalSyncInput>.Skip("External sync is disabled."));
}
public ValueTask<ScheduledSynchronizationOutcome> MapAsync(
RunSynchronization.Request request,
StepExecutionResult<ExternalSyncResponse> result,
StepExecutionPolicyContext context,
CancellationToken cancellationToken)
{
return ValueTask.FromResult(ScheduledSynchronizationOutcome.From(result));
}
}
For policy-managed steps, StepsResults publishes the mapped TStepOutcome, not the raw TStepResponse. Stateful
pipelines persist the mapped outcome and reuse it on resume when ReExecutionPolicy = ReuseIfAvailable.
Diagnostics:
EM105: unsupported policy-managed step signature.EM106: policy type does not implement the exact closedIStepExecutionPolicy<...>contract.
Full consumer guide: ../doc/StepExecutionPolicies.md.
Breaking Changes in 3.0.0
Eternet.Mediator.Generator 3.0.0 emits code against the new generated runtime facade.
- Generated executors no longer declare or pass
ScopedStates. - Generated code uses an assembly-local generated runtime helper backed by
GeneratedBindingRuntime. request.StepsResultsis the supported developer-facing result model.- Applications or tests that still depend on public
ScopedStates-based generated output must stay on2.xuntil migrated.
Migration guide:
../docs/scoped-states-breaking-change-v3.md
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.1.56 | 31 | 6/14/2026 |
| 3.1.55 | 65 | 6/11/2026 |
| 3.1.54 | 89 | 6/10/2026 |
| 3.1.53 | 109 | 6/9/2026 |
| 3.1.52 | 114 | 6/4/2026 |
| 3.1.51 | 105 | 6/4/2026 |
| 3.1.50 | 149 | 5/31/2026 |
| 3.1.49 | 119 | 5/27/2026 |
| 3.1.48 | 143 | 5/26/2026 |
| 3.1.47 | 107 | 5/26/2026 |
| 3.1.46 | 157 | 5/21/2026 |
| 3.1.45 | 96 | 5/20/2026 |
| 3.1.44 | 142 | 5/19/2026 |
| 3.1.43 | 138 | 5/18/2026 |
| 3.1.42 | 137 | 5/15/2026 |
| 3.1.41 | 130 | 5/14/2026 |
| 3.1.40 | 116 | 5/13/2026 |
| 3.1.39 | 112 | 5/12/2026 |
| 3.1.38 | 107 | 5/11/2026 |
| 3.1.37 | 118 | 5/10/2026 |
Generated endpoints and HTTP clients support explicit FromBody direct root payload contracts.