Class DocumentPrecondition
An HTTP precondition for writing or deleting a document, so concurrent writers do not overwrite each other (IEEE 9274.1.1, 4.1.4). A failed precondition throws XapiPreconditionFailedException.
public sealed record DocumentPrecondition : IEquatable<DocumentPrecondition>
- Inheritance
-
DocumentPrecondition
- Implements
- Inherited Members
Properties
HeaderName
The header name: If-Match or If-None-Match.
public string HeaderName { get; }
Property Value
HeaderValue
The header value: an ETag, or *.
public string HeaderValue { get; }
Property Value
IfNoneMatchAny
Only write if no document exists yet: If-None-Match: *.
public static DocumentPrecondition IfNoneMatchAny { get; }
Property Value
Methods
IfMatch(string)
Only write if the document has not changed since it was read: If-Match: <etag>.
public static DocumentPrecondition IfMatch(string etag)
Parameters
etagstringThe ETag of the document as last read.
Returns
- DocumentPrecondition
The precondition.
Remarks
Pass ETag exactly as the LRS returned it, quotes included.