Soenneker.Documents.Typed
11.0.174
Prefix Reserved
dotnet add package Soenneker.Documents.Typed --version 11.0.174
NuGet\Install-Package Soenneker.Documents.Typed -Version 11.0.174
<PackageReference Include="Soenneker.Documents.Typed" Version="11.0.174" />
<PackageVersion Include="Soenneker.Documents.Typed" Version="11.0.174" />
<PackageReference Include="Soenneker.Documents.Typed" />
paket add Soenneker.Documents.Typed --version 11.0.174
#r "nuget: Soenneker.Documents.Typed, 11.0.174"
#:package Soenneker.Documents.Typed@11.0.174
#addin nuget:?package=Soenneker.Documents.Typed&version=11.0.174
#tool nuget:?package=Soenneker.Documents.Typed&version=11.0.174
Soenneker.Documents.Typed
Adds an EntityType discriminator to the base document model for heterogeneous storage containers.
Installation
dotnet add package Soenneker.Documents.Typed
Usage
using Soenneker.Documents.Typed;
public sealed class CustomerDocument : TypedDocument
{
public override string EntityType { get; set; } = "customer";
public string Email { get; set; } = null!;
}
var customer = new CustomerDocument
{
DocumentId = "customer-42",
PartitionKey = "tenant-7",
CreatedAt = DateTimeOffset.UtcNow,
Email = "ada@example.com"
};
EntityType serializes as entityType with System.Text.Json. Identity and timestamp fields come from Document and retain their existing JSON names.
The discriminator is application-defined. This package does not register polymorphic converters, map discriminator values to CLR types, validate uniqueness, or stop callers from changing a value after construction. Keep values stable and configure your serializer or repository to select the correct concrete type during reads.
TypedDocument is abstract because each document family must implement EntityType. Use ITypedDocument when persistence or routing code only needs the shared identity, timestamp, and discriminator contract.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Soenneker.Documents.Document (>= 11.0.2764)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Soenneker.Documents.Typed:
| Package | Downloads |
|---|---|
|
Soenneker.Cosmos.Repositories.Shared
A data persistence abstraction layer for Cosmos DB containers that have multiple document types |
|
|
Soenneker.Documents.General
A document type for general storage purposes, with an EntityType property |
|
|
Soenneker.Documents.Typed.Named
A generic document type for containers that have multiple types of documents that have a name |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 11.0.174 | 302 | 11/11/2026 |
| 11.0.173 | 79 | 11/11/2026 |
| 11.0.172 | 127 | 11/11/2026 |
| 11.0.171 | 118 | 11/11/2026 |
| 11.0.170 | 154 | 11/11/2026 |
| 11.0.169 | 204 | 11/11/2026 |
| 11.0.168 | 86 | 11/10/2026 |
| 11.0.167 | 959 | 11/3/2026 |
| 11.0.166 | 173 | 11/3/2026 |
| 11.0.165 | 222 | 11/2/2026 |
| 11.0.164 | 664 | 10/27/2026 |
| 11.0.162 | 416 | 10/26/2026 |
| 11.0.161 | 134 | 10/26/2026 |
| 4.0.160 | 688 | 10/15/2026 |
| 4.0.159 | 109 | 10/15/2026 |
| 4.0.158 | 123 | 10/14/2026 |
| 4.0.157 | 177 | 10/14/2026 |
| 4.0.156 | 111 | 10/14/2026 |
| 4.0.155 | 169 | 10/14/2026 |
| 4.0.154 | 105 | 10/14/2026 |
Updated Multiple NuGet packages