![]() |
VOOZH | about |
dotnet add package Encamina.Enmarcha.Data.Cosmos --version 10.0.5
NuGet\Install-Package Encamina.Enmarcha.Data.Cosmos -Version 10.0.5
<PackageReference Include="Encamina.Enmarcha.Data.Cosmos" Version="10.0.5" />
<PackageVersion Include="Encamina.Enmarcha.Data.Cosmos" Version="10.0.5" />Directory.Packages.props
<PackageReference Include="Encamina.Enmarcha.Data.Cosmos" />Project file
paket add Encamina.Enmarcha.Data.Cosmos --version 10.0.5
#r "nuget: Encamina.Enmarcha.Data.Cosmos, 10.0.5"
#:package Encamina.Enmarcha.Data.Cosmos@10.0.5
#addin nuget:?package=Encamina.Enmarcha.Data.Cosmos&version=10.0.5Install as a Cake Addin
#tool nuget:?package=Encamina.Enmarcha.Data.Cosmos&version=10.0.5Install as a Cake Tool
Cosmos Data project primarily contains Cosmos DB implementations based on the abstractions provided by , as well as some other utilities related to Cosmos DB.
First, install NuGet. Then, install Encamina.Enmarcha.Data.Cosmos from the package manager console:
PM> Install-Package Encamina.Enmarcha.Data.Cosmos
First, install .NET CLI. Then, install Encamina.Enmarcha.Data.Cosmos from the .NET CLI:
dotnet add package Encamina.Enmarcha.Data.Cosmos
In the following example, we will demonstrate how to configure and add an Cosmos DB implementation of the interface to the ServiceCollection, based on the .
public class Foo
{
[JsonProperty("id")]
public string Id { get; set; }
[JsonProperty("text")]
public string Text { get; set; }
}
First, you need to add the to your project configuration. You can achieve this by using any configuration provider. The followng code is an example of how the settings would appear using the appsettings.json file:
{
// ...
"CosmosOptions": {
"AuthKey": "<Your-AuthKey>", // Authentication key required to connect with Azure Cosmos DB
"Database": "<Your-Database>", // Database name to connect with Azure Cosmos DB
"Endpoint": "<Your-Endpoint>", // Azure Cosmos DB service endpoint to use
// ...
},
"CosmosDBContainerName": "<Your-Cosmos-DB-Container-Name>",
// ...
}
Next, in Program.cs or a similar entry point file in your project, add the following code:
// Entry point
var builder = WebApplication.CreateBuilder(new WebApplicationOptions
{
// ...
});
// ...
// Or others configuration providers...
builder.Configuration.AddJsonFile(@"appsettings.json", optional: true, reloadOnChange: true);
builder.Services.AddCosmos(builder.Configuration);
builder.Services.AddScoped<IAsyncRepository<Foo>>(sp => sp.GetRequiredService<ICosmosRepositoryFactory>()
.Create<Foo>(builder.Configuration.GetValue<string>("CosmosDBContainerName")));
And now, you can resolve the IAsyncRepository<Foo> interface with construction injection:
public class MyClass
{
private readonly IAsyncRepository<Foo> fooRepository;
public MyClass(IAsyncRepository<Foo> fooRepository)
{
this.fooRepository = fooRepository;
}
public async Task TestAddFooAsync(CancellationToken cts)
{
await fooRepository.AddAsync(new Foo() { Text = "Foo1", Id = Guid.NewGuid().ToString()}, cts);
}
}
Within the NuGet package, you will find some extension methods related to Cosmos DB in .
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 netstandard2.1 is compatible. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 1 NuGet packages that depend on Encamina.Enmarcha.Data.Cosmos:
| Package | Downloads |
|---|---|
|
Encamina.Enmarcha.SemanticKernel.Plugins.Chat
Package Description |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.5 | 342 | 6/1/2026 |
| 10.0.4 | 127 | 4/8/2026 |
| 10.0.3 | 1,194 | 4/6/2026 |
| 10.0.2 | 1,844 | 12/17/2025 |
| 10.0.1 | 317 | 12/17/2025 |
| 10.0.0 | 341 | 12/16/2025 |
| 10.0.0-preview-09 | 448 | 11/19/2025 |
| 10.0.0-preview-08 | 424 | 11/18/2025 |
| 10.0.0-preview-07 | 210 | 10/22/2025 |
| 10.0.0-preview-06 | 1,038 | 10/14/2025 |
| 10.0.0-preview-05 | 241 | 10/8/2025 |
| 10.0.0-preview-04 | 210 | 10/7/2025 |
| 10.0.0-preview-03 | 360 | 9/16/2025 |
| 10.0.0-preview-02 | 340 | 9/16/2025 |
| 8.3.0 | 1,078 | 9/10/2025 |
| 8.3.0-preview-02 | 269 | 9/10/2025 |
| 8.3.0-preview-01 | 271 | 9/8/2025 |
| 8.2.1-preview-08 | 221 | 8/18/2025 |
| 8.2.1-preview-07 | 236 | 8/12/2025 |