Cohesive.Transitions
0.1.0-alpha.5
dotnet add package Cohesive.Transitions --version 0.1.0-alpha.5
NuGet\Install-Package Cohesive.Transitions -Version 0.1.0-alpha.5
<PackageReference Include="Cohesive.Transitions" Version="0.1.0-alpha.5" />
<PackageVersion Include="Cohesive.Transitions" Version="0.1.0-alpha.5" />
<PackageReference Include="Cohesive.Transitions" />
paket add Cohesive.Transitions --version 0.1.0-alpha.5
#r "nuget: Cohesive.Transitions, 0.1.0-alpha.5"
#:package Cohesive.Transitions@0.1.0-alpha.5
#addin nuget:?package=Cohesive.Transitions&version=0.1.0-alpha.5&prerelease
#tool nuget:?package=Cohesive.Transitions&version=0.1.0-alpha.5&prerelease
Cohesive.Transitions
Entity transition, invariant, effect, and domain model authoring primitives.
Install
dotnet add package Cohesive.Transitions
Use When
- You want entities to declare semantic fields, invariants, transitions, effects, and continuations.
- You need transition execution to produce explicit state changes and effect snapshots.
- You want domain behavior represented as a model that can later be interpreted by storage, process, API, or UI adapters.
Example
using Cohesive.Transitions.Authoring;
public enum LoadStatus
{
Draft,
Assigned
}
public sealed class Load : Entity<Load>
{
public sealed record AssignCarrierInput(string CarrierId);
public Load()
{
Id = WriteOnceField<string>(nameof(Id));
Status = Field(nameof(Status), LoadStatus.Draft);
CarrierId = Field<string?>(
nameof(CarrierId),
initialValue: null,
configure: field => field.Optional());
AssignCarrier = Transition<AssignCarrierInput>(
nameof(AssignCarrier),
transition => transition
.Requires("CanAssignCarrier", (load, input) =>
load.Status == LoadStatus.Draft && input.CarrierId != "")
.Set(load => load.CarrierId, (_, input) => input.CarrierId)
.Set(load => load.Status, (_, _) => LoadStatus.Assigned)
.EmitSnapshot("CarrierAssigned", (snapshot, input) => new
{
loadId = snapshot.EntityId.Value,
carrierId = input.CarrierId
}));
}
public Field<string> Id { get; }
public Field<LoadStatus> Status { get; }
public Field<string?> CarrierId { get; }
public Transition<Load, AssignCarrierInput> AssignCarrier { get; }
}
Related Packages
Cohesive.Processesfor workflows that invoke entity transitions.Cohesive.Storagefor persistence adapters.Cohesive.Analyzersfor source-generation support around authoring patterns.
Expression Sites
Transition expressions use the shared, non-generic Cohesive.Model.Expr IR and expression
requirements analyzer. The transition model supplies a different scope for each semantic site:
- Preconditions see entity state and declared transition inputs and must produce a Boolean.
- Field updates see entity state and transition inputs and must satisfy the target field contract.
- Computed fields see entity state without transition inputs and must satisfy their field contract.
- Entity invariants see resulting entity state without transition inputs and must produce a Boolean.
These scopes are compiler-front-end descriptions, not serialized CLR evaluation contexts. The transition runtime keeps its own state and input objects, while analysis exposes portable field, parameter, function, operator, and ambient-capability requirements for validation, dependency analysis, documentation, and future interpreters.
| 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. |
-
net10.0
- Cohesive (>= 0.1.0-alpha.5)
- Cohesive.Relations (>= 0.1.0-alpha.5)
NuGet packages (6)
Showing the top 5 NuGet packages that depend on Cohesive.Transitions:
| Package | Downloads |
|---|---|
|
Cohesive.Processes
Cohesive semantic system definition and orchestration building blocks. |
|
|
Cohesive.Api
Cohesive semantic system definition and orchestration building blocks. |
|
|
Cohesive.Storage
Cohesive semantic system definition and orchestration building blocks. |
|
|
Cohesive.Identity
Cohesive semantic system definition and orchestration building blocks. |
|
|
Cohesive.Host
Cohesive semantic system definition and orchestration building blocks. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-alpha.5 | 103 | 7/20/2026 |
| 0.1.0-alpha.4 | 111 | 7/13/2026 |
| 0.1.0-alpha.3 | 113 | 7/8/2026 |
| 0.1.0-alpha.2 | 116 | 7/7/2026 |