Documentation
Everything you need to ship Azure Cosmos DB-backed apps with the
IEvangelist.Azure.CosmosRepository package — installation, partitioning,
querying, the change feed, and more.
Getting started
Install the package, register the repository, and create your first item.
- Overview Install the Microsoft.Azure.CosmosRepository package, register it with DI, and create your first item.
- Authentication Authenticate against Azure Cosmos DB with a connection string or a TokenCredential identity (RBAC).
- Partitioning Pick the right Cosmos DB partitioning strategy with attributes, the container builder, or a synthetic key.
Container configuration
Configure container properties, throughput, and serialization.
Item types
Item, EtagItem, TimeStampedItem, TimeToLiveItem, and FullItem.
- Overview Pick the right base class — Item, EtagItem, TimeStampedItem, TimeToLiveItem, or FullItem.
- Etags & OCC Avoid lost updates with EtagItem, FullItem, and IItemWithEtag.
- FullItem One base class that combines etags, timestamps, and time-to-live.
- Timestamps Track CreatedTimeUtc, LastUpdatedTimeUtc, and the raw `_ts` for every item.
- Time to live Set TTL at the container or item level using TimeToLiveItem and FullItem.
Queries
Query items with predicates, paging, and the Specification pattern.
Change feed
Process Cosmos DB change feed events with hosted background services.
Miscellaneous
Health checks, logging, unique keys, and container initialization.
- Container initialization Choose between lazy (default) and eager container creation for predictable startup.
- Health checks ASP.NET Core health checks for Cosmos DB powered by Cosmos Repository's container metadata.
- Logging Event ID ranges and the high-performance logging strategy used by the library.
- Unique keys Enforce uniqueness within a partition with [UniqueKey] attributes.
Release notes
Major release notes and migration guidance.
API reference
Auto-generated reference for every public type in the package, with members, parameters, and remarks.