Table of Contents

Interface IAzureCosmosDBServiceBase

Namespace
FoundationaLLM.Context.Interfaces
Assembly
FoundationaLLM.Context.dll

Defines the interface for the Azure Cosmos DB service that provides core database services.

public interface IAzureCosmosDBServiceBase
Extension Methods

Properties

ContextContainer

Gets the context container for the Azure Cosmos DB service.

Container ContextContainer { get; }

Property Value

Container

Methods

RetrieveItems<T>(QueryDefinition)

Retrieves items from Azure Cosmos DB.

Task<List<T>> RetrieveItems<T>(QueryDefinition query)

Parameters

query QueryDefinition

The query definition used to retrieve the items.

Returns

Task<List<T>>

The list of retrieved items.

Type Parameters

T

The type of item to retrieve.

UpsertItemAsync<T>(string, T, CancellationToken)

Upserts an item in Azure Cosmos DB.

Task<T> UpsertItemAsync<T>(string partitionKey, T item, CancellationToken cancellationToken = default)

Parameters

partitionKey string

The partition of the item to upsert.

item T

The item to upsert.

cancellationToken CancellationToken

The cancellation token used to signal a cancellation request.

Returns

Task<T>

The upserted item.

Type Parameters

T

The type of the item to upsert.