Table of Contents

Class CosmosClientFactory

Namespace
eQuantic.Core.Data.CosmosDb
Assembly
eQuantic.Core.Data.CosmosDb.dll

Builds CosmosClients configured the way this provider expects: the CosmosEntitySerializer (System.Text.Json web defaults + the modeling annotations, and the model's Converts registrations when a model is given) — wired as a CosmosLinqSerializer so LINQ member names resolve through the same contract — and bulk execution enabled so a buffered Commit flushes as one batched set of point writes.

public static class CosmosClientFactory
Inheritance
CosmosClientFactory
Inherited Members

Properties

SerializerOptions

The System.Text.Json options used to (de)serialize documents when no model is supplied.

public static JsonSerializerOptions SerializerOptions { get; }

Property Value

JsonSerializerOptions

Methods

Create(string)

Creates a client from a connection string with the default options.

public static CosmosClient Create(string connectionString)

Parameters

connectionString string

The Cosmos connection string.

Returns

CosmosClient

Create(string, CosmosModel, ILoggerFactory?)

Creates a client whose serializer carries the model's value converters.

public static CosmosClient Create(string connectionString, CosmosModel model, ILoggerFactory? loggerFactory = null)

Parameters

connectionString string

The Cosmos connection string.

model CosmosModel

The Cosmos model.

loggerFactory ILoggerFactory

The logging factory feeding the request log/metrics pipeline, or null.

Returns

CosmosClient

DefaultOptions()

The default client options (annotation-aware serializer, bulk execution enabled).

public static CosmosClientOptions DefaultOptions()

Returns

CosmosClientOptions

OptionsFor(CosmosModel, ILoggerFactory?)

The client options for a model (its Converts registrations join the serializer).

public static CosmosClientOptions OptionsFor(CosmosModel model, ILoggerFactory? loggerFactory = null)

Parameters

model CosmosModel

The Cosmos model.

loggerFactory ILoggerFactory

The logging factory feeding the request log/metrics pipeline, or null.

Returns

CosmosClientOptions