Class AccessCondition
Represents a set of access conditions to be used for operations in the Azure Cosmos DB service.
public sealed class AccessCondition
- Inheritance
-
AccessCondition
- Inherited Members
- Extension Methods
Examples
The following example shows how to use AccessCondition with DocumentClient.
// If ETag is current, then this will succeed. Otherwise the request will fail with HTTP 412 Precondition Failure
await client.ReplaceDocumentAsync(
readCopyOfBook.SelfLink,
new Book { Title = "Moby Dick", Price = 14.99 },
new RequestOptions
{
AccessCondition = new AccessCondition
{
Condition = readCopyOfBook.ETag,
Type = AccessConditionType.IfMatch
}
});
Constructors
AccessCondition()
public AccessCondition()
Properties
Condition
Gets or sets the value of the condition in the Azure Cosmos DB service.
public string Condition { get; set; }
Property Value
- string
The value of the condition. For AccessConditionType IfMatch and IfNotMatch, this is the ETag that has to be compared to.
- See Also
Type
Gets or sets the condition type in the Azure Cosmos DB service.
public AccessConditionType Type { get; set; }
Property Value
- AccessConditionType
The condition type. Can be IfMatch or IfNoneMatch.