Stateless 5.16.0-dev-9221217254
See the version list below for details.
dotnet add package Stateless --version 5.16.0-dev-9221217254
NuGet\Install-Package Stateless -Version 5.16.0-dev-9221217254
<PackageReference Include="Stateless" Version="5.16.0-dev-9221217254" />
<PackageVersion Include="Stateless" Version="5.16.0-dev-9221217254" />
<PackageReference Include="Stateless" />
paket add Stateless --version 5.16.0-dev-9221217254
#r "nuget: Stateless, 5.16.0-dev-9221217254"
#:package Stateless@5.16.0-dev-9221217254
#addin nuget:?package=Stateless&version=5.16.0-dev-9221217254&prerelease
#tool nuget:?package=Stateless&version=5.16.0-dev-9221217254&prerelease
Stateless
Create state machines and lightweight state machine-based workflows directly in .NET code:
var phoneCall = new StateMachine<State, Trigger>(State.OffHook);
phoneCall.Configure(State.OffHook)
.Permit(Trigger.CallDialled, State.Ringing);
phoneCall.Configure(State.Connected)
.OnEntry(t => StartCallTimer())
.OnExit(t => StopCallTimer())
.InternalTransition(Trigger.MuteMicrophone, t => OnMute())
.InternalTransition(Trigger.UnmuteMicrophone, t => OnUnmute())
.InternalTransition<int>(_setVolumeTrigger, (volume, t) => OnSetVolume(volume))
.Permit(Trigger.LeftMessage, State.OffHook)
.Permit(Trigger.PlacedOnHold, State.OnHold);
// ...
phoneCall.Fire(Trigger.CallDialled);
Assert.AreEqual(State.Ringing, phoneCall.State);
This project, as well as the example above, was inspired by Simple State Machine (Archived).
Features
Most standard state machine constructs are supported:
- Generic support for states and triggers of any .NET type (numbers, strings, enums, etc.)
- Hierarchical states
- Entry/exit actions for states
- Guard clauses to support conditional transitions
- Introspection
Some useful extensions are also provided:
- Ability to store state externally (for example, in a property tracked by an ORM)
- Parameterised triggers
- Reentrant states
- Export to DOT graph
Documentation
For guidance on how to use Stateles, the project README file contains documentation and code examples. The source repository also includes a few example projects.
Contributing
We welcome contributions to this project. Check CONTRIBUTING.md for more info.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.2
- No dependencies.
-
.NETStandard 2.0
- No dependencies.
-
net8.0
- No dependencies.
NuGet packages (70)
Showing the top 5 NuGet packages that depend on Stateless:
| Package | Downloads |
|---|---|
|
LittleForker
A utility to assist with spawning child processes, monitor their lifecycle and co-operative shutdown. |
|
|
DiegoRangel.DotNet.Framework.CQRS.Domain.Core
A common library for implementing CQRS based Domain layer. |
|
|
Delfin.Core.Application
A robust Application Layer library designed to facilitate the implementation of business logic and application services in .NET applications. This package provides essential abstractions, command and query handling, and integration with domain models, ensuring a clean architecture and separation of concerns. |
|
|
Hyperledger.Aries
.NET Core tools for building agent services |
|
|
WalletFramework
.NET Core tools for building agent services |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 5.20.1 | 249,855 | 2/9/2026 |
| 5.20.1-dev-23984902460 | 92 | 4/4/2026 |
| 5.20.1-dev-19407615528 | 4,108 | 11/16/2025 |
| 5.20.1-dev-19407520956 | 276 | 11/16/2025 |
| 5.20.0 | 696,907 | 9/18/2025 |
| 5.20.0-dev-17841589139 | 357 | 9/18/2025 |
| 5.19.0 | 138,716 | 8/22/2025 |
| 5.19.0-dev-17621326750 | 354 | 9/18/2025 |
| 5.19.0-dev-17157499513 | 193 | 8/22/2025 |
| 5.18.0 | 115,998 | 8/3/2025 |
| 5.18.0-dev-17151133875 | 203 | 8/22/2025 |
| 5.18.0-dev-17151048893 | 197 | 8/22/2025 |
| 5.18.0-dev-17123170070 | 226 | 8/21/2025 |
| 5.18.0-dev-16986834496 | 215 | 8/15/2025 |
| 5.18.0-dev-16665478063 | 177 | 8/1/2025 |
| 5.18.0-dev-16665368567 | 208 | 8/1/2025 |
| 5.17.0 | 2,685,413 | 12/30/2024 |
| 5.17.0-dev-16123181037 | 231 | 7/7/2025 |
| 5.17.0-dev-12573353197 | 259 | 1/1/2025 |
| 5.16.0-dev-9221217254 | 251 | 5/24/2024 |