Condividi tramite


ConsistencyPolicy Class

Definition

The consistency policy for the Cosmos DB database account.

public class ConsistencyPolicy : System.ClientModel.Primitives.IJsonModel<Azure.ResourceManager.CosmosDB.Models.ConsistencyPolicy>, System.ClientModel.Primitives.IPersistableModel<Azure.ResourceManager.CosmosDB.Models.ConsistencyPolicy>
type ConsistencyPolicy = class
    interface IJsonModel<ConsistencyPolicy>
    interface IPersistableModel<ConsistencyPolicy>
Public Class ConsistencyPolicy
Implements IJsonModel(Of ConsistencyPolicy), IPersistableModel(Of ConsistencyPolicy)
Inheritance
ConsistencyPolicy
Implements

Constructors

ConsistencyPolicy(DefaultConsistencyLevel)

Initializes a new instance of ConsistencyPolicy.

Properties

DefaultConsistencyLevel

The default consistency level and configuration settings of the Cosmos DB account.

MaxIntervalInSeconds

When used with the Bounded Staleness consistency level, this value represents the time amount of staleness (in seconds) tolerated. Accepted range for this value is 5 - 86400. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'.

MaxStalenessPrefix

When used with the Bounded Staleness consistency level, this value represents the number of stale requests tolerated. Accepted range for this value is 1 – 2,147,483,647. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'.

Methods

JsonModelWriteCore(Utf8JsonWriter, ModelReaderWriterOptions)

Explicit Interface Implementations

IJsonModel<ConsistencyPolicy>.Create(Utf8JsonReader, ModelReaderWriterOptions)

Reads one JSON value (including objects or arrays) from the provided reader and converts it to a model.

IJsonModel<ConsistencyPolicy>.Write(Utf8JsonWriter, ModelReaderWriterOptions)

Writes the model to the provided Utf8JsonWriter.

IPersistableModel<ConsistencyPolicy>.Create(BinaryData, ModelReaderWriterOptions)

Converts the provided BinaryData into a model.

IPersistableModel<ConsistencyPolicy>.GetFormatFromOptions(ModelReaderWriterOptions)

Gets the data interchange format (JSON, Xml, etc) that the model uses when communicating with the service.

IPersistableModel<ConsistencyPolicy>.Write(ModelReaderWriterOptions)

Writes the model into a BinaryData.

Applies to