NxGraph.Serialization
2.1.0-alpha
dotnet add package NxGraph.Serialization --version 2.1.0-alpha
NuGet\Install-Package NxGraph.Serialization -Version 2.1.0-alpha
<PackageReference Include="NxGraph.Serialization" Version="2.1.0-alpha" />
<PackageVersion Include="NxGraph.Serialization" Version="2.1.0-alpha" />
<PackageReference Include="NxGraph.Serialization" />
paket add NxGraph.Serialization --version 2.1.0-alpha
#r "nuget: NxGraph.Serialization, 2.1.0-alpha"
#:package NxGraph.Serialization@2.1.0-alpha
#addin nuget:?package=NxGraph.Serialization&version=2.1.0-alpha&prerelease
#tool nuget:?package=NxGraph.Serialization&version=2.1.0-alpha&prerelease
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:
- Graph structure —
GraphSerializer.ToJsonAsync/ToBinaryAsync(node logic encoded via yourILogicCodec). - Machine position — a shallow
StateMachineSnapshotor, when the flow's suspension points live inside composites, a deepStateMachineDeepSnapshotfromSuspendDeep()(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. - One payload per blackboard —
BlackboardSerializer.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 | Versions 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. |
-
net8.0
- MessagePack (>= 3.1.7)
- NxGraph.Serialization.Abstraction (>= 2.1.0-alpha)
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 |