Cohesive.Adapters.Cosmos 0.1.0-alpha.3

This is a prerelease version of Cohesive.Adapters.Cosmos.
dotnet add package Cohesive.Adapters.Cosmos --version 0.1.0-alpha.3
                    
NuGet\Install-Package Cohesive.Adapters.Cosmos -Version 0.1.0-alpha.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Cohesive.Adapters.Cosmos" Version="0.1.0-alpha.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Cohesive.Adapters.Cosmos" Version="0.1.0-alpha.3" />
                    
Directory.Packages.props
<PackageReference Include="Cohesive.Adapters.Cosmos" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Cohesive.Adapters.Cosmos --version 0.1.0-alpha.3
                    
#r "nuget: Cohesive.Adapters.Cosmos, 0.1.0-alpha.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Cohesive.Adapters.Cosmos@0.1.0-alpha.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Cohesive.Adapters.Cosmos&version=0.1.0-alpha.3&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Cohesive.Adapters.Cosmos&version=0.1.0-alpha.3&prerelease
                    
Install as a Cake Tool

Cohesive.Adapters.Cosmos

Azure Cosmos DB adapters for Cohesive storage, relation query compilation, aggregation, outbox records, and vector storage.

Install

dotnet add package Cohesive.Adapters.Cosmos

Use When

  • You want Cohesive entity and observation storage backed by Azure Cosmos DB.
  • You need relation query or aggregation plans compiled to Cosmos SQL.
  • You want Cosmos-backed vector storage or process outbox persistence.

Example

using Cohesive.Adapters.Cosmos;
using Cohesive.Model;
using Cohesive.Relations.Queries;
using Cohesive.Storage;
using Microsoft.Azure.Cosmos;

await using var environment = await CosmosClientFactory.Shared.CreateDatabaseEnvironment(
    new CosmosDatabaseEnvironmentOptions(
        ClientOptions: new()
        {
            Endpoint = configuration["Cosmos:Endpoint"],
            UseDefaultCredential = true
        },
        DatabaseName: "cohesive-dev"),
    containers:
    [
        new ContainerProperties(id: "entities", partitionKeyPath: "/partitionKey"),
        new ContainerProperties(id: "leases", partitionKeyPath: "/id")
    ]);

var entityContainer = environment.ContainersByName["entities"].Item2;
var leaseContainer = environment.ContainersByName["leases"].Item2;

services.RegisterEntityRepository(LoadEntity.Instance, (_, _) =>
    new CosmosEntityOutboxRepository(
        entityDefinition: LoadEntity.Instance.Definition,
        container: entityContainer,
        leaseContainer: leaseContainer,
        partitionKeyPolicy: EntityPartitionKeyPolicy.FromField(nameof(LoadState.TenantId)),
        options: new CosmosObservationOutboxRepositoryOptions
        {
            InstanceName = "dispatch-worker"
        }));

var predicate = new EntityPredicate(new And<FieldPredicate>(
[
    new FieldPredicate(FieldPath.FromField(nameof(LoadState.Status)), new ExactValuePredicate("open")),
    new FieldPredicate(FieldPath.FromField(nameof(LoadState.CustomerId)), new ExactValuePredicate("customer-42"))
]));

CosmosSqlQuery sql = new CosmosSqlQueryCompiler().Compile(predicate);
QueryDefinition cosmosQuery = sql.ToQueryDefinition();
  • Cohesive.Storage for repository abstractions.
  • Cohesive.Relations for query and aggregation plans.
  • Cohesive.AI for vector storage contracts.
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-alpha.3 39 7/8/2026
0.1.0-alpha.2 43 7/7/2026