CosmosDbContextOptionsBuilder Class

Definition

Allows Cosmos specific configuration to be performed on DbContextOptions.

Instances of this class are returned from a call to CosmosDbContextOptionsExtensions.UseCosmos{TContext} and it is not designed to be directly constructed in your application code.

public class CosmosDbContextOptionsBuilder
type CosmosDbContextOptionsBuilder = class
Public Class CosmosDbContextOptionsBuilder
Inheritance
CosmosDbContextOptionsBuilder

Constructors

CosmosDbContextOptionsBuilder(DbContextOptionsBuilder)

Initializes a new instance of the CosmosDbContextOptionsBuilder class.

Methods

ConnectionMode(ConnectionMode)

Configures the context to use the provided connection mode.

Equals(Object)

Determines whether the specified object is equal to the current object.

ExecutionStrategy(Func<ExecutionStrategyDependencies,IExecutionStrategy>)

Configures the context to use the provided IExecutionStrategy.

GatewayModeMaxConnectionLimit(Int32)

Configures the maximum number of concurrent connections allowed for the target service endpoint in the Azure Cosmos DB service.

GetHashCode()

Serves as the default hash function.

IdleTcpConnectionTimeout(TimeSpan)

Configures the amount of idle time after which unused connections are closed.

LimitToEndpoint(Boolean)

Limits the operations to the provided endpoint.

MaxRequestsPerTcpConnection(Int32)

Configures the number of requests allowed simultaneously over a single TCP connection. When more requests are in flight simultaneously, the direct/TCP client will open additional connections.

MaxTcpConnectionsPerEndpoint(Int32)

Configures the maximum number of TCP connections that may be opened to each Cosmos DB back-end. Together with MaxRequestsPerTcpConnection, this setting limits the number of requests that are simultaneously sent to a single Cosmos DB back-end (MaxRequestsPerTcpConnection x MaxTcpConnectionPerEndpoint).

OpenTcpConnectionTimeout(TimeSpan)

Configures the amount of time allowed for trying to establish a connection.

Region(String)

Configures the context to use the provided geo-replicated region.

RequestTimeout(TimeSpan)

Configures the timeout when connecting to the Azure Cosmos DB service. The number specifies the time to wait for response to come back from network peer.

ToString()

Returns a string that represents the current object.

WebProxy(IWebProxy)

Configures the proxy information used for web requests.

WithOption(Func<CosmosOptionsExtension,CosmosOptionsExtension>)

Sets an option by cloning the extension used to store the settings. This ensures the builder does not modify options that are already in use elsewhere.

Applies to