CanDoItAll.Ledger.Storage.InMemory
0.1.18
dotnet add package CanDoItAll.Ledger.Storage.InMemory --version 0.1.18
NuGet\Install-Package CanDoItAll.Ledger.Storage.InMemory -Version 0.1.18
<PackageReference Include="CanDoItAll.Ledger.Storage.InMemory" Version="0.1.18" />
<PackageVersion Include="CanDoItAll.Ledger.Storage.InMemory" Version="0.1.18" />
<PackageReference Include="CanDoItAll.Ledger.Storage.InMemory" />
paket add CanDoItAll.Ledger.Storage.InMemory --version 0.1.18
#r "nuget: CanDoItAll.Ledger.Storage.InMemory, 0.1.18"
#:package CanDoItAll.Ledger.Storage.InMemory@0.1.18
#addin nuget:?package=CanDoItAll.Ledger.Storage.InMemory&version=0.1.18
#tool nuget:?package=CanDoItAll.Ledger.Storage.InMemory&version=0.1.18
CanDoItAll.Ledger.Storage.InMemory
Thread-safe in-memory Ledger storage for tests and disposable single-process development.
The store implements ILedgerConfirmationStore and serializes confirmation
inside one instance. Use it when a fast, isolated ledger is more important than
durability or multi-process coordination.
Requirements
- .NET 10
Install
dotnet add package CanDoItAll.Ledger.Storage.InMemory
Use Directly
using CanDoItAll.Ledger.Core;
using CanDoItAll.Ledger.Storage.InMemory;
ILedgerStore store = new InMemoryLedgerStore();
LedgerState? state = await store.GetLedgerStateAsync(
new LedgerId("agent-expenses"),
scenarioId: null,
CancellationToken.None);
Register
using CanDoItAll.Ledger.Core;
using CanDoItAll.Ledger.Storage.InMemory;
builder.Services.AddSingleton<InMemoryLedgerStore>();
builder.Services.AddSingleton<ILedgerStore>(
services => services.GetRequiredService<InMemoryLedgerStore>());
builder.Services.AddSingleton<ILedgerConfirmationStore>(
services => services.GetRequiredService<InMemoryLedgerStore>());
Use a singleton when one process should share one disposable ledger. A scoped or transient registration creates separate stores and therefore separate ledger state.
Limitations
- All data is lost when the owning process or service instance ends.
- The store has no backup, restore, migration, or cross-process coordination path.
- Its confirmation lock protects one store instance only.
- It is appropriate for unit tests, examples, and disposable local tools, not authoritative agent or project expense records.
- Use
CanDoItAll.Ledger.Persistence.PostgreSqlfor a durable node.
See the Engine package, PostgreSQL provider, and full source.
This package is part of the CanDoItAll ecosystem and uses the repository's MIT License.
| 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
- CanDoItAll.Ledger.Core (>= 0.1.18)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on CanDoItAll.Ledger.Storage.InMemory:
| Package | Downloads |
|---|---|
|
CanDoItAll.Ledger.Components
Reusable Blazor components and workspaces for ledger accounts, transactions, business objects, analytics, and node operations. |
GitHub repositories
This package is not used by any popular GitHub repositories.