Trellis.Stateless
3.0.0-alpha.104
This is a prerelease version of Trellis.Stateless.
dotnet add package Trellis.Stateless --version 3.0.0-alpha.104
NuGet\Install-Package Trellis.Stateless -Version 3.0.0-alpha.104
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.Stateless" Version="3.0.0-alpha.104" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Trellis.Stateless" Version="3.0.0-alpha.104" />
<PackageReference Include="Trellis.Stateless" />
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.Stateless --version 3.0.0-alpha.104
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Trellis.Stateless, 3.0.0-alpha.104"
#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.Stateless@3.0.0-alpha.104
#: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.Stateless&version=3.0.0-alpha.104&prerelease
#tool nuget:?package=Trellis.Stateless&version=3.0.0-alpha.104&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Stateless State Machine Integration
Wraps the Stateless library's Fire() method to return Result<TState> instead of throwing on invalid transitions.
Installation
dotnet add package Trellis.Stateless
Quick Start
using Stateless;
using Trellis;
using Trellis.Stateless;
var machine = new StateMachine<OrderState, OrderTrigger>(OrderState.New);
machine.Configure(OrderState.New)
.Permit(OrderTrigger.Submit, OrderState.Submitted);
// Returns Result<OrderState> — no exceptions on invalid transitions
Result<OrderState> result = machine.FireResult(OrderTrigger.Submit);
// result.IsSuccess == true, result.Value == OrderState.Submitted
Result<OrderState> invalid = machine.FireResult(OrderTrigger.Cancel);
// invalid.IsFailure == true, invalid.Error is DomainError
How It Works
- Uses Stateless's
CanFire()to check before firing — no try/catch internally - Returns
Result<TState>with the new state on success - Returns a
DomainErroron invalid transitions
Related Packages
- Trellis.Results — Core
Result<T>type - Stateless — State machine library (required dependency)
License
MIT — see LICENSE for details.
| 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.16.0)
- Trellis.Results (>= 3.0.0-alpha.104)
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.104 | 0 | 3/9/2026 |
| 3.0.0-alpha.100 | 36 | 3/4/2026 |
| 3.0.0-alpha.99 | 37 | 3/4/2026 |
| 3.0.0-alpha.98 | 34 | 3/3/2026 |
| 3.0.0-alpha.95 | 41 | 3/2/2026 |
| 3.0.0-alpha.94 | 40 | 3/2/2026 |
| 3.0.0-alpha.93 | 41 | 3/1/2026 |
| 3.0.0-alpha.92 | 54 | 2/28/2026 |
| 3.0.0-alpha.83 | 42 | 2/27/2026 |