Stratara.Domain
3.1.2
See the version list below for details.
dotnet add package Stratara.Domain --version 3.1.2
NuGet\Install-Package Stratara.Domain -Version 3.1.2
<PackageReference Include="Stratara.Domain" Version="3.1.2" />
<PackageVersion Include="Stratara.Domain" Version="3.1.2" />
<PackageReference Include="Stratara.Domain" />
paket add Stratara.Domain --version 3.1.2
#r "nuget: Stratara.Domain, 3.1.2"
#:package Stratara.Domain@3.1.2
#addin nuget:?package=Stratara.Domain&version=3.1.2
#tool nuget:?package=Stratara.Domain&version=3.1.2
Stratara.Domain
License: FSL-1.1-MIT (Functional Source License — source-available; converts to MIT after 2 years). Not OSI-approved OSS.
The Stratara framework's concrete multitenancy domain — the Tenant aggregate and its event vocabulary. Use this when your application wants Stratara's opinionated tenant model (one tenant per customer, lifecycle events for activate / deactivate / rename / locale-change / assignment) and the corresponding aggregate.
Contents
Stratara.Domain.Multitenancy.Tenant— the aggregate. ImplementsIAggregate(fromStratara.Abstractions).Stratara.Domain.TenantCreated/TenantRenamed/TenantActivated/TenantDeactivated/TenantDefaultLocaleChanged/TenantAssignedToCustomer/TenantDeleted/CustomerTenantsDeleted— the event records consumed by the aggregate'sApply()methods + persisted to the event stream.
When to skip this package
If you're building a Stratara-on-Mediator application without the framework's tenant model (e.g. you have your own tenancy concept), reference Stratara.Abstractions alone for the marker interfaces. Most Stratara features (CQRS, event sourcing, projections, sagas) don't depend on Stratara.Domain.
Quick reference
// Open a Tenant stream from a command handler
await events.CreateAsync<Tenant>(tenantId,
new TenantCreated(
Id: tenantId,
CustomerId: customerId,
Name: "Acme",
DefaultLocale: "de-DE",
IsActive: true,
CreatedAt: DateTimeOffset.UtcNow),
cancellationToken);
await events.SaveChangesAsync(cancellationToken);
// Later: rehydrate the aggregate
var tenant = await aggregator.AggregateAsync<Tenant>(tenantId, cancellationToken: cancellationToken);
Dependencies
Stratara.Abstractions— forIAggregate(Tenant implements it).JetBrains.Annotations— for static-analysis attributes.
| 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
- JetBrains.Annotations (>= 2025.2.4)
- Stratara.Abstractions (>= 3.1.2)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Stratara.Domain:
| Package | Downloads |
|---|---|
|
Stratara.Shared
Umbrella package for the Stratara framework — source-generated logger extensions for outbox / saga / projection / messaging, domain-event helpers, merge primitives, and the Tier-A/B abstractions surface re-exported as one transitive bundle. |
|
|
Stratara.Projections
Projection runtime for the Stratara event-sourced stack — projection-handler discovery, change-set creation, update application, and projection manager. Sits between read-model repositories and the event-bundle dispatcher. |
|
|
Stratara.Sagas
Saga runtime for the Stratara event-sourced stack — ISaga discovery, manager / handler dispatch, cached method invoker, and a hosted SagaWorker that routes incoming event bundles to matching sagas. |
GitHub repositories
This package is not used by any popular GitHub repositories.
### Added
- **New package `Stratara.Testing`** — test doubles and assertion helpers so consumers can
unit-test Stratara-based code without Postgres or RabbitMQ testcontainers. Reference it from
test projects only.
- `AggregateTestHarness<T>` + `Aggregate.Rehydrate<T>(...)` — given/when/then rehydration of an
aggregate from events using the same reflection-based `Apply(...)` dispatch as the production
aggregation service. It throws on an event with no matching `Apply` overload so a forgotten or
mistyped overload fails the test; opt back into the production-lenient skip with
`IgnoringUnmappedEvents()`.
- `InMemoryKeyStore` — an `IKeyStore` that mints random 256-bit DEKs per `KeyScope` and supports
rotation / revocation / scope-erasure without a master KEK or key file.
- `TestBlobEncryptor.CreateAesGcm()` — the real AES-GCM `ISecureBlobEncryptor` over an
`InMemoryKeyStore`, so blob round-trips exercise production encryption.
- `InMemoryMessageBus` — an `IMessageBus` with synchronous in-process dispatch and a `Published`
list for assertions.
- `TestSessionContext` / `TestSessionContextProvider` — preset Actor/Subject `SessionContext`
values and an `ISessionContextProvider` double.
- `TestTenants.Of("acme")` — stable, deterministic tenant/user ids from readable slugs.
`TestSessionContext` sets both correlation and causation ids so the context can drive
event-store writes.
- `TestEvent.Create(payload, ...)` — wrap an event payload in `IEvent<T>` with realistic
metadata; `ProjectionTester.HandleAsync(projection, event)` — invoke a projection's private
`HandleAsync` handler directly to unit-test it against mocked repositories.
- **New package `Stratara.Testing.EntityFrameworkCore`** — spins up the **real** event-sourcing
write stack (`IEventSource`, `IAggregationService`, snapshots, the EF Core write store) against a
shared in-memory SQLite database in one call, so tests exercise production code paths without
Postgres or Docker. Reference it from test projects only.
- `EventStoreTestHost.Create(...)` — owns the SQLite connection + service provider; exposes
`ExecuteAsync(IEventSource)`, `AggregateAsync<T>(streamId)`, the preset `Session`, and the
recording `Outbox`.
- `AddStrataraTestingEventStore<TWriteDbContext>(connection, tenantId)` — the lower-level DI
extension; `StrataraTestWriteDbContext` — a ready-made concrete write context;
`RecordingEventBundleOutboxDispatcher` — captures emitted bundles for assertions.
- The lockstep family grows from 22 to 24 packable packages.