Benday.CosmosDb
4.9.0
See the version list below for details.
dotnet add package Benday.CosmosDb --version 4.9.0
NuGet\Install-Package Benday.CosmosDb -Version 4.9.0
<PackageReference Include="Benday.CosmosDb" Version="4.9.0" />
<PackageVersion Include="Benday.CosmosDb" Version="4.9.0" />
<PackageReference Include="Benday.CosmosDb" />
paket add Benday.CosmosDb --version 4.9.0
#r "nuget: Benday.CosmosDb, 4.9.0"
#:package Benday.CosmosDb@4.9.0
#addin nuget:?package=Benday.CosmosDb&version=4.9.0
#tool nuget:?package=Benday.CosmosDb&version=4.9.0
Benday.CosmosDb
A collection of classes for implementing the domain model and repository patterns with Azure Cosmos Db. These classes are built using the Azure Cosmos DB libraries for .NET and aim to simplify using hierarchical partition keys and to make sure that query operations are created to use those partition keys correctly.
Written by Benjamin Day
Pluralsight Author | Microsoft MVP | Scrum.org Professional Scrum Trainer
https://www.benday.com
https://www.slidespeaker.ai
info@benday.com
YouTube: https://www.youtube.com/@_benday
Key features
- Interfaces and base classes for implementing the repository pattern with CosmosDb
- Interfaces and base classes for implementing the domain model pattern with CosmosDb
- Help you to write LINQ queries against CosmosDb without having to worry whether you're using the right partition keys
- Support for configuring repositories for use in ASP.NET Core projects
- Support for hierarchical partition keys
- Logging of query performance and request units
- Detect and warn when you have cross-partition queries
- Helper classes and methods for registering types and handling connection configuration
- Ultra-simple configuration for Azure Cosmos DB Linux emulator
Quick Start
For Azure Cosmos DB Emulator (Development)
{
"CosmosConfiguration": {
"UseEmulator": true
}
}
That's it! See EMULATOR-SETUP.md for complete emulator configuration guide.
For Production
var config = new CosmosConfigBuilder()
.WithEndpoint("https://your-cosmos.documents.azure.com:443/")
.UseDefaultAzureCredential()
.WithDatabase("ProductionDb")
.WithContainer("ProductionContainer")
.Build();
Got ideas for CosmosDb functionality that you'd like to see? Found a bug? Let us know by submitting an issue https://github.com/benday-inc/Benday.CosmosDb/issues*. Want to contribute? Submit a pull request.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- Azure.Identity (>= 1.16.0)
- Microsoft.Azure.Cosmos (>= 3.53.1)
- Microsoft.Extensions.Configuration (>= 9.0.9)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.9)
- Microsoft.Extensions.Options (>= 9.0.9)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Benday.CosmosDb:
| Package | Downloads |
|---|---|
|
Benday.Identity.CosmosDb
ASP.NET Core Identity implementation using Azure Cosmos DB as the backing store. Provides user store, role store, claims, lockout, two-factor authentication, and external login support. Built on top of the Benday.CosmosDb repository pattern library. |
|
|
Benday.Identity.CosmosDb.UI
ASP.NET Core Identity UI for Azure Cosmos DB. Provides pre-built Login/Logout/AccessDenied Razor Pages, a RedirectToLogin Blazor component, and AddCosmosIdentityWithUI() convenience method that combines core identity registration with cookie authentication. Built on top of Benday.Identity.CosmosDb. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 6.1.1 | 164 | 7/3/2026 |
| 6.1.0 | 143 | 6/19/2026 |
| 6.0.10 | 161 | 5/10/2026 |
| 6.0.9-alpha | 137 | 4/27/2026 |
| 6.0.8-alpha | 144 | 4/20/2026 |
| 6.0.7-alpha | 123 | 4/20/2026 |
| 6.0.3-alpha | 132 | 4/14/2026 |
| 6.0.2-alpha | 169 | 4/6/2026 |
| 6.0.0-alpha | 151 | 3/25/2026 |
| 5.3.0 | 180 | 3/12/2026 |
| 5.2.0 | 429 | 1/9/2026 |
| 5.1.0 | 331 | 12/16/2025 |
| 5.0.0 | 370 | 11/12/2025 |
| 4.10.0 | 263 | 11/6/2025 |
| 4.9.0 | 211 | 9/27/2025 |
| 4.8.0 | 401 | 8/8/2025 |
| 4.7.1 | 327 | 8/7/2025 |
| 4.6.1 | 282 | 6/14/2025 |
| 4.5.0 | 245 | 4/25/2025 |
| 4.4.0 | 246 | 3/22/2025 |
v4.9 - Added simplified config options for local emulator; Added configuration builder extension method to simplify configuration of cosmos db in web projects; Added better paging support to repository;
v4.8 - Refactored batch save to make the saving of each batch be a protected virtual method; Added batch size property;
v4.7 - Adding BeforeSaveBatch and AfterSaveBatch template methods;
v4.6 - Added configure option to use DefaultAzureCredential for authentication using managed service ids in azure; Fixed bug where cosmos client was improperly registered in DI when using managed ids;
v4.5 - Added option to configure 'allow bulk execution' for the CosmosClient; Default value for 'allow bulk execution' is now true;
v4.4 - Changed configuration reader to use default values rather than throwing exceptions when optional values are missing;
v4.3 - Fixed bug where UseHierarchicalPartitionKey was sometimes not being set;
v4.2.2 - Allowed cosmos db options UseHierarchicalPartitionKey to be set-able;
v4.2.1 - Minor bug fix release;
v4.2 - Fixed partition key bug on SaveAsync when in flat-partition key mode;
v4.1 - Added option to CosmosConfig.ConnectionString to enable GatewayMode via connection string;
v4.0 - Added support for non-hierarchical partition keys and made it the default; Added support for the beta version of the linux emulator container; Added configuration options for gateway mode and database throughput; Breaking change: renamed OwnedItemService interface and classes;
v3.0 - Changed framework target to be netstandard2.1; Added helper classes and methods to simplify type registrations;
v2.1 - Added optimistic concurrency checks using _etag to the repository SaveAsync method.
v2.0 - Changed implementation to use System.Text.Json for serialization instead of Newtonsoft.Json. Added configuration utilities to make it easier to configure CosmosDb in web projects. Added service layer base classes.
v1.0 - Adding initial version of the CosmosDb Domain Model & Repository utilities