Cratis Chronicle .NET client setup
The Cratis Chronicle .NET client connects your application to an event store so you can record what happened and build read models from that history. Use it directly in a console application or let ASP.NET Core and Worker Service hosting configure the client through dependency injection.
Start with the .NET setup guide to connect and append an event. This section covers .NET APIs and hosting; the shared Chronicle guides explain event-sourcing concepts and provide examples for the participating clients.
When to use it
Section titled “When to use it”Use the .NET client when you are building:
- a console tool or script that talks directly to Chronicle
- an ASP.NET Core service that appends events from endpoints or Arc commands
- a Worker Service that registers projections, hosts reducers or reactors, or appends events in the background
- a .NET test project that uses Chronicle’s in-process testing scenarios
Install
Section titled “Install”Add Cratis.Chronicle to an existing .NET application. For ASP.NET Core hosting, add Cratis.Chronicle.AspNetCore too. Chronicle templates already include the packages for their host style.
dotnet add package Cratis.Chronicledotnet add package Cratis.Chronicle.AspNetCoreEvent content round trips
Section titled “Event content round trips”When you append and read an event, a nullable property reads back as null whether it was stored as
null or omitted. The client can omit nulls during serialization, but a nullable decimal? or
int? holding 0 remains a value. Missing non-nullable values become their type defaults where
the schema permits them.
Raw JSON equality can therefore misrepresent an event-content comparison. The kernel’s
schema-aware ContentComparison / VerifyContent path accounts for these rules; these are kernel
verification mechanisms, not .NET client methods. See
Null, absent, and default values.
Shared Chronicle topics
Section titled “Shared Chronicle topics”- Get started
- Events and event logs
- Appending events
- Read models
- Projections
- Reactors
- Reducers
- Constraints
.NET-specific pages
Section titled “.NET-specific pages”- Health checks
- Short-lived processes
- Serverless mode
- Explicit artifact registration
- Discovery reports and identity drift
- Registration outcomes
- Console quickstart
- ASP.NET Core hosting
- Worker Service hosting
- .NET connection strings
- .NET namespace resolution
- .NET event type migrations
- Seeding events with C#
Shared examples
Section titled “Shared examples”Shared guides show C# examples alongside the other clients available for that task in synchronized language tabs. Their C# source lives in Chronicle/Documentation/client-snippets/**; use the .NET-specific pages above for setup and APIs that differ by client.