Primodel.Sdk.TestKit 5.0.0

dotnet add package Primodel.Sdk.TestKit --version 5.0.0
                    
NuGet\Install-Package Primodel.Sdk.TestKit -Version 5.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="Primodel.Sdk.TestKit" Version="5.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Primodel.Sdk.TestKit" Version="5.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Primodel.Sdk.TestKit" />
                    
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 Primodel.Sdk.TestKit --version 5.0.0
                    
#r "nuget: Primodel.Sdk.TestKit, 5.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 Primodel.Sdk.TestKit@5.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=Primodel.Sdk.TestKit&version=5.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Primodel.Sdk.TestKit&version=5.0.0
                    
Install as a Cake Tool

Primodel.Sdk

Write plugins for Primodel — the governed data platform that maps vendor systems to a canonical model.

A plugin is a normal .NET class library. It adds a source, a target, a format, a SQL dialect or a storage engine to a running Primodel instance, and it ships and upgrades on its own schedule: installing one does not mean redeploying the product.

dotnet add package Primodel.Sdk

A minimal plugin

Three pieces: a role, a factory that binds it once from typed settings, and a package that registers it under a key.

using System.Runtime.InteropServices;
using Primodel.Sdk.Catalog;
using Primodel.Sdk.Plugins;
using Primodel.Sdk.Records;
using Primodel.Sdk.Roles;

// Settings are yours. They arrive as the flow author wrote them, secrets already resolved.
public sealed class GreetingSettings
{
    public string Name { get; set; } = "world";
    public int Count { get; set; } = 1;
}

public sealed class GreetingSource(GreetingSettings settings) : IRecordSource
{
    public async IAsyncEnumerable<RecordBatch> ReadAsync(IRecordContextPool pool, IRunContext context)
    {
        var records = new RecordContext[settings.Count];
        for (var i = 0; i < settings.Count; i++)
        {
            var record = pool.Rent();
            record.SetString("greeting", ("hello " + settings.Name).AsMemory());
            records[i] = record;
        }

        yield return new RecordBatch(records, records.Length);
        await Task.CompletedTask;
    }
}

// Bound once, when the flow compiles. The role never sees its settings again.
public sealed class GreetingSourceFactory : IRecordSourceFactory<GreetingSettings>
{
    public ValueTask<IRecordSource> BindAsync(
        GreetingSettings settings, IAdapterServices services, CancellationToken cancellationToken) =>
        ValueTask.FromResult<IRecordSource>(new GreetingSource(settings));
}

public sealed class GreetingPlugin : IPluginPackage
{
    public string Id => "primodel-greeting";      // must match your assembly name
    public string Version => "1.0.0";
    public IReadOnlyCollection<Architecture> SupportedArchitectures => [];   // empty = fully managed
    public PluginActivationMode ActivationMode => PluginActivationMode.Hot;

    public void Register(IPluginRegistrationContext context) =>
        context.Roles.Register<IRecordSource, GreetingSourceFactory, GreetingSettings>(
            "greeting", new RoleCapabilities(RoleLifetime.Job));
}

A flow step naming "greeting" now runs your source.

The package id and the assembly name must match. The loader resolves a package's entry assembly as {id}.dll, so a mismatch produces a plugin that installs, verifies, activates — and never loads.

What you can contribute

There is one contract family: the roles in Primodel.Sdk.Roles, registered only through IPluginRegistrationContext.Roles (an IRoleCatalog). Each role is created once by an IRoleFactory, then runs without settings.

You implement For
IMessageSource yielding messages: a file (one message), a paged API or a broker (N messages), each settled
IMessageTarget delivering messages, one session per endpoint, plus ProbeAsync to test an endpoint
IMessageTransform reshaping a message, 1:1 or 1:N
IRecordSource / IRecordTarget reading records from a system, writing records to one
IRecordTransform reshaping records mid-flow, declaring stateless or stateful
IFormat decode, encode and inspect one format with one parser; RoleCapabilities.FormatDirection says which directions the key serves
IInboundProtocol / IAcknowledgementBuilder receiving a wire protocol, and building its acknowledgement later

Beyond roles, IPluginRegistrationContext also takes a SQL dialect, a materialize writer, a stream source provider, a lake provider, a connection type and a message broker: enough to add a database engine, an object store, or a broker the product has never heard of.

An expected remote failure is a value, not an exception: a DeliveryOutcome, a MessageSettlement, a response message carrying Http-Status, a ConnectionResult from ProbeAsync, or IRunContext.Quarantine for a record that cannot be parsed. Throw only for configuration errors, bugs and cancellation.

What the host gives you

A plugin never calls back into Primodel. It asks, through interfaces the SDK declares and the host implements. IAdapterServices is handed to your factory at bind time:

  • Logger — structured logging, scoped by the host to your package id. Always Logger.LogX("template {Field}", value).
  • Egress (IEgressServices) — vet and dial any host a flow's settings name. Use it. An endpoint written into a flow is attacker-reachable in a way a registered connection is not, and this is what applies the operator's allowlist and the cloud-metadata exclusion.
  • Formats (IFormatResolver) — bind whatever format is registered under a key, including formats installed after your plugin shipped.
  • TradingPartners (ITradingPartnerEnvelopes) — resolve a registered trading partner and allocate its next EDI control numbers.
  • Credentials, Records, Messages, Payloads, Clock — resolved credentials, the record and message pools, the claim-check store and the time source.

IRunContext is the per-run half: cancellation, paging, the incremental watermark, quarantine for records you cannot parse, and progress.

Testing

dotnet add package Primodel.Sdk.TestKit

Test doubles for the host side (FakeAdapterServices, FakeRunContext), a RecordingRoleCatalog to assert what your package registers, source and format harnesses, and a conformance suite per role plus one for registration. Derive from the suite for each role you register and the checks run against your implementation. It tracks the SDK version exactly.

Support and versioning

Semantic versioning applies. 5.0.0 removed the pre-roles contract families; the migration table is in docs/migrating-to-5.0.md. A host refuses a package built on another SDK major, with a message naming the package, so rebuild plugins when you move major versions.

Issues and questions: github.com/Wadman-IT/Primodel-SDK. Design notes on what belongs in this contract and why are in docs/design.md.

Licence

Apache-2.0. This SDK is the contract you build against and is deliberately open; Primodel itself and its first-party plugin packages are separately licensed commercial software.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
5.0.0 0 11/21/2026
4.6.0 176 11/19/2026
4.5.0 47 11/19/2026
4.4.0 107 11/18/2026
4.3.0 80 11/18/2026
4.2.0 141 11/17/2026
4.1.2 84 11/17/2026
4.1.1 86 11/17/2026
4.1.0 124 11/17/2026
4.0.0 125 11/16/2026
3.1.2 89 11/12/2026
3.1.1 90 11/9/2026
3.1.0 89 11/9/2026
3.0.0 1,035 10/31/2026
2.4.0 162 10/30/2026
2.3.0 125 10/26/2026
2.2.0 187 10/26/2026
2.1.0 720 10/3/2026
2.0.0 201 10/1/2026
1.1.1 164 9/25/2026
Loading failed