NxGraph.Serialization 2.1.0-alpha

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

NxGraph.Serialization

This project provides serialization and deserialization functionalities for NxGraph objects, allowing you to easily save and load graph structures.

Blackboard payloads

A durable flow is shipped as separate artifacts, each with its own lifecycle:

  1. Graph structureGraphSerializer.ToJsonAsync/ToBinaryAsync (node logic encoded via your ILogicCodec).
  2. Machine position — a shallow StateMachineSnapshot or, when the flow's suspension points live inside composites, a deep StateMachineDeepSnapshot from SuspendDeep() (which additionally captures composite-internal position — nested machines, history children, sync parallel regions). Both are primitives-only records you serialize with any serializer; the library never serializes them itself.
  3. One payload per blackboardBlackboardSerializer.ToJsonAsync/ToBinaryAsync; a global board saves once per world, graph boards per entity.

Restore is restore-into: schemas are code and cannot be reconstructed from a payload, so you create a live Blackboard over the current schema and apply the payload over its defaults (RestoreFromJsonAsync/RestoreFromBinaryAsync). Post-state is always defaults + payload — keys added to the schema after the save keep their defaults, and stale pre-restore values never survive.

Schema drift is handled by BlackboardMismatchPolicy:

Payload vs live schema Strict (default) Skip
Schema name or scope differs throws whole restore is a no-op
Payload key unknown to the schema throws entry ignored
Key's value type changed throws entry ignored (slot keeps its default)
Key missing from the payload default default
Corrupt/undeserializable value throws throws (Skip is for schema evolution, not corruption)
Payload version newer than the serializer throws throws

Custom value types plug in through the constructor options — supply JsonSerializerOptions converters and/or a MessagePackSerializerOptions resolver (e.g. ContractlessStandardResolver). Payload type names are verification data only and are never used to resolve a type.

Note: graph payloads do not carry blackboard schema declarations (GraphDto is unchanged) — a deserialized Graph has Schema == null and binds boards permissively; the per-key schema check in Blackboard remains the runtime safety net.

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 was computed.  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

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
2.1.0-alpha 45 7/17/2026
2.0.0 243 9/7/2025
1.0.3 224 9/4/2025
1.0.1 233 9/4/2025
1.0.0 224 9/3/2025