Trellis.StateMachine
3.0.0-alpha.382
This is a prerelease version of Trellis.StateMachine.
dotnet add package Trellis.StateMachine --version 3.0.0-alpha.382
NuGet\Install-Package Trellis.StateMachine -Version 3.0.0-alpha.382
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="Trellis.StateMachine" Version="3.0.0-alpha.382" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Trellis.StateMachine" Version="3.0.0-alpha.382" />
<PackageReference Include="Trellis.StateMachine" />
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 Trellis.StateMachine --version 3.0.0-alpha.382
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Trellis.StateMachine, 3.0.0-alpha.382"
#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 Trellis.StateMachine@3.0.0-alpha.382
#: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=Trellis.StateMachine&version=3.0.0-alpha.382&prerelease
#tool nuget:?package=Trellis.StateMachine&version=3.0.0-alpha.382&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Trellis.StateMachine
A thin Trellis wrapper for Stateless that returns Result<TState> for transitions.
Installation
dotnet add package Trellis.StateMachine
Quick Example
using Stateless;
using Trellis;
using Trellis.StateMachine;
enum OrderState { Draft, Submitted }
enum OrderTrigger { Submit }
var machine = new StateMachine<OrderState, OrderTrigger>(OrderState.Draft);
machine.Configure(OrderState.Draft).Permit(OrderTrigger.Submit, OrderState.Submitted);
Result<OrderState> result = machine.FireResult(OrderTrigger.Submit);
Key Features
- Convert invalid transitions into typed domain failures instead of raw exceptions.
- Keep state-machine code inside the same Result pipeline as the rest of your app.
- Support lazy state-machine construction for materialized aggregates.
Documentation
Part of Trellis
This package is part of the Trellis framework.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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.
-
net10.0
- Stateless (>= 5.20.1)
- Trellis.Core (>= 3.0.0-alpha.382)
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.0.0-alpha.382 | 42 | 6/12/2026 |
| 3.0.0-alpha.372 | 37 | 6/10/2026 |
| 3.0.0-alpha.360 | 63 | 6/7/2026 |
| 3.0.0-alpha.342 | 81 | 6/5/2026 |
| 3.0.0-alpha.337 | 59 | 6/3/2026 |
| 3.0.0-alpha.336 | 46 | 6/3/2026 |
| 3.0.0-alpha.304 | 58 | 5/29/2026 |