IEvangelist.Azure.CosmosRepository
2.0.1
See the version list below for details.
dotnet add package IEvangelist.Azure.CosmosRepository --version 2.0.1
NuGet\Install-Package IEvangelist.Azure.CosmosRepository -Version 2.0.1
<PackageReference Include="IEvangelist.Azure.CosmosRepository" Version="2.0.1" />
<PackageVersion Include="IEvangelist.Azure.CosmosRepository" Version="2.0.1" />
<PackageReference Include="IEvangelist.Azure.CosmosRepository" />
paket add IEvangelist.Azure.CosmosRepository --version 2.0.1
#r "nuget: IEvangelist.Azure.CosmosRepository, 2.0.1"
#:package IEvangelist.Azure.CosmosRepository@2.0.1
#addin nuget:?package=IEvangelist.Azure.CosmosRepository&version=2.0.1
#tool nuget:?package=IEvangelist.Azure.CosmosRepository&version=2.0.1
Azure Cosmos DB Repository .NET SDK
This package wraps the NuGet: Microsoft.Azure.Cosmos package,
exposing a simple dependency-injection enabled IRepository<T> interface. The repository is responsible for all
of the create, read, update, and delete (CRUD) operations on objects where T : Item. The Item type adds
several properties, one which is a globally unique identifier defined as:
[JsonProperty("id")]
public string Id { get; set; } = Guid.NewGuid().ToString();
Additionally, a type property exists which indicates the subclass name (this is used for filtering implicitly on your behalf):
[JsonProperty("type")]
public string Type { get; set; }
Finally, a partition key properpty is used internally to manage partitioning on your behalf.
📣 Azure Cosmos DB - Offical Blog
Getting started
Create an Azure Cosmos DB SQL resource.
Obtain the resource connection string from the Keys blade, be sure to get a connection string and not the key - these are different. The connection string is a compound key and endpoint URL.
Call
AddCosmosRepositoryand provide the apps configuration object:public void ConfigureServices(IServiceCollection services) { services.AddCosmosRepository(Configuration); }The optional
setupActionallows consumers to manually configure theRepositoryOptionsobject:public void ConfigureServices(IServiceCollection services) { services.AddCosmosRepository(Configuration, options => { options.CosmosConnectionString = "< connection string >"; options.ContainerId = "data-store"; options.DatabaseId = "samples"; }); }Define your object graph, objects must inherit
Item, for example:using Microsoft.Azure.CosmosRepository; public class Person : Item { public string FirstName { get; set; } public string LastName { get; set; } }Ask for an instance of
IRepository<TItem>, in this case theTItemisPerson:using Microsoft.Azure.CosmosRepository; public class Consumer { readonly IRepository<Person> _repository; public Consumer(IRepository<Person> repository) => _respository = repository; // Use the repo... }Perform any of the operations on the
_repositoryinstance, createPersonrecords, update them, read them, or delete.Enjoy!
| 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 | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. 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.0
- Microsoft.Azure.Cosmos (>= 3.13.0)
- Microsoft.Extensions.Http (>= 3.1.8)
- Microsoft.Extensions.Logging (>= 3.1.8)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 3.1.8)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on IEvangelist.Azure.CosmosRepository:
| Package | Downloads |
|---|---|
|
IEvangelist.Azure.CosmosRepository.AspNetCore
This client library enables client applications to connect to Azure Cosmos via a repository pattern around the official Azure Cosmos .NET SDK. Azure Cosmos is a globally distributed, multi-model database service. For more information, refer to http://azure.microsoft.com/services/cosmos-db/. |
|
|
AIC.Core.Data.CosmosDb
Shared .NET library for Aerospace, Intelligence, and Cyber solutions. |
|
|
IEvangelist.Azure.CosmosEventSourcing
This client library enables client applications to connect to Azure Cosmos and use it as an event sourcing store. |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on IEvangelist.Azure.CosmosRepository:
| Repository | Stars |
|---|---|
|
IEvangelist/learning-blazor
The application for the "Learning Blazor: Build Single Page Apps with WebAssembly and C#" O'Reilly Media book by David Pine.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.2 | 18,766 | 3/10/2026 |
| 10.0.1 | 19,720 | 1/9/2026 |
| 9.0.2 | 100,172 | 6/30/2025 |
| 9.0.1 | 102,637 | 12/3/2024 |
| 9.0.0 | 10,235 | 11/21/2024 |
| 8.1.7 | 186,326 | 7/1/2024 |
| 8.1.6 | 3,338 | 6/30/2024 |
| 8.1.5 | 50,619 | 4/10/2024 |
| 8.1.4 | 89,421 | 3/7/2024 |
| 8.1.3 | 21,028 | 2/8/2024 |
| 8.1.2 | 98,267 | 11/29/2023 |
| 8.1.1 | 2,439 | 11/27/2023 |
| 8.1.0 | 1,254 | 11/27/2023 |
| 8.0.0 | 2,726 | 11/20/2023 |
| 7.1.0 | 30,909 | 9/30/2023 |
| 7.0.2 | 13,360 | 8/25/2023 |
| 7.0.1 | 55,031 | 1/22/2023 |
| 7.0.0 | 7,155 | 1/4/2023 |
| 2.0.1 | 1,229 | 10/12/2020 |
| 0.0.0-alpha.0 | 412 | 12/11/2025 |