Soenneker.Documents.Document
4.0.2695
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.Documents.Document --version 4.0.2695
NuGet\Install-Package Soenneker.Documents.Document -Version 4.0.2695
<PackageReference Include="Soenneker.Documents.Document" Version="4.0.2695" />
<PackageVersion Include="Soenneker.Documents.Document" Version="4.0.2695" />
<PackageReference Include="Soenneker.Documents.Document" />
paket add Soenneker.Documents.Document --version 4.0.2695
#r "nuget: Soenneker.Documents.Document, 4.0.2695"
#:package Soenneker.Documents.Document@4.0.2695
#addin nuget:?package=Soenneker.Documents.Document&version=4.0.2695
#tool nuget:?package=Soenneker.Documents.Document&version=4.0.2695
Soenneker.Documents.Document
Provides a base document model with storage identity, partition, and timestamp fields.
Installation
dotnet add package Soenneker.Documents.Document
Define a document
using Soenneker.Documents.Document;
public sealed class CustomerDocument : Document
{
public string Name { get; set; } = null!;
}
var customer = new CustomerDocument
{
DocumentId = "customer-42",
PartitionKey = "tenant-7",
CreatedAt = DateTimeOffset.UtcNow,
Name = "Ada Lovelace"
};
string? internalId = customer.Id; // tenant-7:customer-42
DocumentId serializes as id; PartitionKey serializes as partitionKey. CreatedAt and ModifiedAt serialize as createdAt and modifiedAt. These names are declared for both System.Text.Json and Newtonsoft.Json.
Id is an internal convenience value and is ignored by both serializers. Its behavior is:
- If one key is missing, it returns the other.
- If both keys are equal, it returns that value once.
- If the keys differ, it returns
PartitionKey:DocumentId. - Assigning a value containing colons splits at the last colon.
- Assigning a value without a colon sets both
PartitionKeyandDocumentIdto that value. - Assigning null, empty, or whitespace does nothing.
Because the format has no escaping, DocumentId should not contain a colon when Id must round-trip through its setter. A partition key may contain colons because parsing reserves the final segment for DocumentId.
customer.Id = "tenant:region:customer-42";
// PartitionKey == "tenant:region"
// DocumentId == "customer-42"
New instances do not automatically receive identifiers or timestamps. The [Required] attributes provide validation metadata but do not initialize values or make mutable instances thread-safe; populate and validate documents before persistence.
| 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
- Soenneker.Entities.Entity (>= 4.0.695)
- Soenneker.Extensions.String (>= 4.0.728)
NuGet packages (6)
Showing the top 5 NuGet packages that depend on Soenneker.Documents.Document:
| Package | Downloads |
|---|---|
|
Soenneker.Documents.Audit
A derivation of Document that specifically exists for audit purposes |
|
|
Soenneker.Documents.Named
Providing a name property on Document |
|
|
Soenneker.AutoFaker.Overrides.Documents.Document
An AutoFaker (AutoBogus) override for the base Document object |
|
|
Soenneker.Zelos.Repository
A data persistence abstraction layer for Zelos DB |
|
|
Soenneker.Extensions.Enumerable.Document
A collection of helpful IEnumerable Document extension methods |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.2698 | 0 | 8/30/2026 |
| 4.0.2697 | 0 | 8/30/2026 |
| 4.0.2696 | 49 | 8/30/2026 |
| 4.0.2695 | 50 | 8/30/2026 |
| 4.0.2694 | 47 | 8/30/2026 |
| 4.0.2693 | 99 | 8/29/2026 |
| 4.0.2691 | 277 | 8/29/2026 |
| 4.0.2690 | 706 | 8/26/2026 |
| 4.0.2689 | 378 | 8/25/2026 |
| 4.0.2688 | 836 | 8/21/2026 |
| 4.0.2687 | 1,059 | 8/18/2026 |
| 4.0.2686 | 436 | 8/18/2026 |
| 4.0.2685 | 1,221 | 8/12/2026 |
| 4.0.2684 | 1,098 | 8/8/2026 |
| 4.0.2683 | 847 | 8/7/2026 |
| 4.0.2682 | 977 | 7/29/2026 |
| 4.0.2681 | 650 | 7/28/2026 |
| 4.0.2680 | 260 | 7/28/2026 |
| 4.0.2679 | 526 | 7/28/2026 |
| 4.0.2678 | 299 | 7/28/2026 |
Update dependency Soenneker.Extensions.String to 4.0.728 (#3584)