xml/Microsoft.Azure.Cosmos/ItemRequestOptions.xml (121 lines of code) (raw):

<Type Name="ItemRequestOptions" FullName="Microsoft.Azure.Cosmos.ItemRequestOptions"> <TypeSignature Language="C#" Value="public class ItemRequestOptions : Microsoft.Azure.Cosmos.RequestOptions" /> <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit ItemRequestOptions extends Microsoft.Azure.Cosmos.RequestOptions" /> <TypeSignature Language="DocId" Value="T:Microsoft.Azure.Cosmos.ItemRequestOptions" /> <TypeSignature Language="VB.NET" Value="Public Class ItemRequestOptions&#xA;Inherits RequestOptions" /> <TypeSignature Language="F#" Value="type ItemRequestOptions = class&#xA; inherit RequestOptions" /> <AssemblyInfo> <AssemblyName>Microsoft.Azure.Cosmos.Client</AssemblyName> <AssemblyVersion>3.36.0.0</AssemblyVersion> <AssemblyVersion>3.38.1.0</AssemblyVersion> <AssemblyVersion>3.39.0.0</AssemblyVersion> <AssemblyVersion>3.45.0.0</AssemblyVersion> <AssemblyVersion>3.47.0.0</AssemblyVersion> </AssemblyInfo> <Base> <BaseTypeName>Microsoft.Azure.Cosmos.RequestOptions</BaseTypeName> </Base> <Interfaces /> <Docs> <summary> Cosmos item request options </summary> <remarks>To be added.</remarks> </Docs> <Members> <Member MemberName=".ctor"> <MemberSignature Language="C#" Value="public ItemRequestOptions ();" /> <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" /> <MemberSignature Language="DocId" Value="M:Microsoft.Azure.Cosmos.ItemRequestOptions.#ctor" /> <MemberSignature Language="VB.NET" Value="Public Sub New ()" /> <MemberType>Constructor</MemberType> <AssemblyInfo> <AssemblyName>Microsoft.Azure.Cosmos.Client</AssemblyName> <AssemblyVersion>3.47.0.0</AssemblyVersion> </AssemblyInfo> <Parameters /> <Docs> <summary>To be added.</summary> <remarks>To be added.</remarks> </Docs> </Member> <Member MemberName="ConsistencyLevel"> <MemberSignature Language="C#" Value="public Microsoft.Azure.Cosmos.ConsistencyLevel? ConsistencyLevel { get; set; }" /> <MemberSignature Language="ILAsm" Value=".property instance valuetype System.Nullable`1&lt;valuetype Microsoft.Azure.Cosmos.ConsistencyLevel&gt; ConsistencyLevel" /> <MemberSignature Language="DocId" Value="P:Microsoft.Azure.Cosmos.ItemRequestOptions.ConsistencyLevel" /> <MemberSignature Language="VB.NET" Value="Public Property ConsistencyLevel As Nullable(Of ConsistencyLevel)" /> <MemberSignature Language="F#" Value="member this.ConsistencyLevel : Nullable&lt;Microsoft.Azure.Cosmos.ConsistencyLevel&gt; with get, set" Usage="Microsoft.Azure.Cosmos.ItemRequestOptions.ConsistencyLevel" /> <MemberType>Property</MemberType> <AssemblyInfo> <AssemblyName>Microsoft.Azure.Cosmos.Client</AssemblyName> <AssemblyVersion>3.47.0.0</AssemblyVersion> </AssemblyInfo> <ReturnValue> <ReturnType>System.Nullable&lt;Microsoft.Azure.Cosmos.ConsistencyLevel&gt;</ReturnType> </ReturnValue> <Docs> <summary> Gets or sets the consistency level required for the request in the Azure Cosmos DB service. </summary> <value> The consistency level required for the request. </value> <remarks> Azure Cosmos DB offers 5 different consistency levels. Strong, Bounded Staleness, Session, Consistent Prefix and Eventual - in order of strongest to weakest consistency. <see cref="T:Microsoft.Azure.Cosmos.ConnectionPolicy" /><para> While this is set at a database account level, Azure Cosmos DB allows a developer to override the default consistency level for each individual request. </para></remarks> </Docs> </Member> <Member MemberName="DedicatedGatewayRequestOptions"> <MemberSignature Language="C#" Value="public Microsoft.Azure.Cosmos.DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; }" /> <MemberSignature Language="ILAsm" Value=".property instance class Microsoft.Azure.Cosmos.DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions" /> <MemberSignature Language="DocId" Value="P:Microsoft.Azure.Cosmos.ItemRequestOptions.DedicatedGatewayRequestOptions" /> <MemberSignature Language="VB.NET" Value="Public Property DedicatedGatewayRequestOptions As DedicatedGatewayRequestOptions" /> <MemberSignature Language="F#" Value="member this.DedicatedGatewayRequestOptions : Microsoft.Azure.Cosmos.DedicatedGatewayRequestOptions with get, set" Usage="Microsoft.Azure.Cosmos.ItemRequestOptions.DedicatedGatewayRequestOptions" /> <MemberType>Property</MemberType> <AssemblyInfo> <AssemblyName>Microsoft.Azure.Cosmos.Client</AssemblyName> <AssemblyVersion>3.47.0.0</AssemblyVersion> </AssemblyInfo> <ReturnValue> <ReturnType>Microsoft.Azure.Cosmos.DedicatedGatewayRequestOptions</ReturnType> </ReturnValue> <Docs> <summary> Gets or sets the <see cref="P:Microsoft.Azure.Cosmos.ItemRequestOptions.DedicatedGatewayRequestOptions" /> for requests against the dedicated gateway. These options are only exercised when <see cref="T:Microsoft.Azure.Cosmos.ConnectionMode" /> is set to ConnectionMode.Gateway and the dedicated gateway endpoint is used for sending requests. </summary> <value>To be added.</value> <remarks> Learn more about dedicated gateway <a href="https://azure.microsoft.com/services/cosmos-db/">here</a>. </remarks> </Docs> </Member> <Member MemberName="EnableContentResponseOnWrite"> <MemberSignature Language="C#" Value="public bool? EnableContentResponseOnWrite { get; set; }" /> <MemberSignature Language="ILAsm" Value=".property instance valuetype System.Nullable`1&lt;bool&gt; EnableContentResponseOnWrite" /> <MemberSignature Language="DocId" Value="P:Microsoft.Azure.Cosmos.ItemRequestOptions.EnableContentResponseOnWrite" /> <MemberSignature Language="VB.NET" Value="Public Property EnableContentResponseOnWrite As Nullable(Of Boolean)" /> <MemberSignature Language="F#" Value="member this.EnableContentResponseOnWrite : Nullable&lt;bool&gt; with get, set" Usage="Microsoft.Azure.Cosmos.ItemRequestOptions.EnableContentResponseOnWrite" /> <MemberType>Property</MemberType> <AssemblyInfo> <AssemblyName>Microsoft.Azure.Cosmos.Client</AssemblyName> <AssemblyVersion>3.47.0.0</AssemblyVersion> </AssemblyInfo> <ReturnValue> <ReturnType>System.Nullable&lt;System.Boolean&gt;</ReturnType> </ReturnValue> <Docs> <summary> Gets or sets the boolean to only return the headers and status code in the Cosmos DB response for write item operation like Create, Upsert, Patch and Replace. Setting the option to false will cause the response to have a null resource. This reduces networking and CPU load by not sending the resource back over the network and serializing it on the client. </summary> <value>To be added.</value> <remarks> This is optimal for workloads where the returned resource is not used. </remarks> <example> <code language="c#"><![CDATA[ ItemRequestOptions requestOptions = new ItemRequestOptions() { EnableContentResponseOnWrite = false }; ItemResponse itemResponse = await this.container.CreateItemAsync<ToDoActivity>(tests, new PartitionKey(test.status), requestOptions); Assert.AreEqual(HttpStatusCode.Created, itemResponse.StatusCode); Assert.IsNull(itemResponse.Resource); ]]></code> </example> </Docs> </Member> <Member MemberName="IndexingDirective"> <MemberSignature Language="C#" Value="public Microsoft.Azure.Cosmos.IndexingDirective? IndexingDirective { get; set; }" /> <MemberSignature Language="ILAsm" Value=".property instance valuetype System.Nullable`1&lt;valuetype Microsoft.Azure.Cosmos.IndexingDirective&gt; IndexingDirective" /> <MemberSignature Language="DocId" Value="P:Microsoft.Azure.Cosmos.ItemRequestOptions.IndexingDirective" /> <MemberSignature Language="VB.NET" Value="Public Property IndexingDirective As Nullable(Of IndexingDirective)" /> <MemberSignature Language="F#" Value="member this.IndexingDirective : Nullable&lt;Microsoft.Azure.Cosmos.IndexingDirective&gt; with get, set" Usage="Microsoft.Azure.Cosmos.ItemRequestOptions.IndexingDirective" /> <MemberType>Property</MemberType> <AssemblyInfo> <AssemblyName>Microsoft.Azure.Cosmos.Client</AssemblyName> <AssemblyVersion>3.47.0.0</AssemblyVersion> </AssemblyInfo> <ReturnValue> <ReturnType>System.Nullable&lt;Microsoft.Azure.Cosmos.IndexingDirective&gt;</ReturnType> </ReturnValue> <Docs> <summary> Gets or sets the indexing directive (Include or Exclude) for the request in the Azure Cosmos DB service. </summary> <value> The indexing directive to use with a request. </value> <remarks>To be added.</remarks> <altmember cref="P:Microsoft.Azure.Cosmos.ItemRequestOptions.IndexingDirective" /> <altmember cref="T:Microsoft.Azure.Cosmos.IndexingPolicy" /> </Docs> </Member> <Member MemberName="PostTriggers"> <MemberSignature Language="C#" Value="public System.Collections.Generic.IEnumerable&lt;string&gt; PostTriggers { get; set; }" /> <MemberSignature Language="ILAsm" Value=".property instance class System.Collections.Generic.IEnumerable`1&lt;string&gt; PostTriggers" /> <MemberSignature Language="DocId" Value="P:Microsoft.Azure.Cosmos.ItemRequestOptions.PostTriggers" /> <MemberSignature Language="VB.NET" Value="Public Property PostTriggers As IEnumerable(Of String)" /> <MemberSignature Language="F#" Value="member this.PostTriggers : seq&lt;string&gt; with get, set" Usage="Microsoft.Azure.Cosmos.ItemRequestOptions.PostTriggers" /> <MemberType>Property</MemberType> <AssemblyInfo> <AssemblyName>Microsoft.Azure.Cosmos.Client</AssemblyName> <AssemblyVersion>3.47.0.0</AssemblyVersion> </AssemblyInfo> <ReturnValue> <ReturnType>System.Collections.Generic.IEnumerable&lt;System.String&gt;</ReturnType> </ReturnValue> <Docs> <summary> Gets or sets the trigger to be invoked after the operation in the Azure Cosmos DB service. </summary> <value> The trigger to be invoked after the operation. </value> <remarks> Only valid when used with Create, Replace and Delete methods for items. Currently only one PostTriggers is permitted per operation. </remarks> </Docs> </Member> <Member MemberName="PreTriggers"> <MemberSignature Language="C#" Value="public System.Collections.Generic.IEnumerable&lt;string&gt; PreTriggers { get; set; }" /> <MemberSignature Language="ILAsm" Value=".property instance class System.Collections.Generic.IEnumerable`1&lt;string&gt; PreTriggers" /> <MemberSignature Language="DocId" Value="P:Microsoft.Azure.Cosmos.ItemRequestOptions.PreTriggers" /> <MemberSignature Language="VB.NET" Value="Public Property PreTriggers As IEnumerable(Of String)" /> <MemberSignature Language="F#" Value="member this.PreTriggers : seq&lt;string&gt; with get, set" Usage="Microsoft.Azure.Cosmos.ItemRequestOptions.PreTriggers" /> <MemberType>Property</MemberType> <AssemblyInfo> <AssemblyName>Microsoft.Azure.Cosmos.Client</AssemblyName> <AssemblyVersion>3.47.0.0</AssemblyVersion> </AssemblyInfo> <ReturnValue> <ReturnType>System.Collections.Generic.IEnumerable&lt;System.String&gt;</ReturnType> </ReturnValue> <Docs> <summary> Gets or sets the trigger to be invoked before the operation in the Azure Cosmos DB service. </summary> <value> The trigger to be invoked before the operation. </value> <remarks> Only valid when used with Create, Replace and Delete methods for items. Currently only one PreTrigger is permitted per operation. </remarks> </Docs> </Member> <Member MemberName="SessionToken"> <MemberSignature Language="C#" Value="public string SessionToken { get; set; }" /> <MemberSignature Language="ILAsm" Value=".property instance string SessionToken" /> <MemberSignature Language="DocId" Value="P:Microsoft.Azure.Cosmos.ItemRequestOptions.SessionToken" /> <MemberSignature Language="VB.NET" Value="Public Property SessionToken As String" /> <MemberSignature Language="F#" Value="member this.SessionToken : string with get, set" Usage="Microsoft.Azure.Cosmos.ItemRequestOptions.SessionToken" /> <MemberType>Property</MemberType> <AssemblyInfo> <AssemblyName>Microsoft.Azure.Cosmos.Client</AssemblyName> <AssemblyVersion>3.47.0.0</AssemblyVersion> </AssemblyInfo> <ReturnValue> <ReturnType>System.String</ReturnType> </ReturnValue> <Docs> <summary> Gets or sets the token for use with session consistency in the Azure Cosmos DB service. </summary> <value> The token for use with session consistency. </value> <remarks> One of the <see cref="P:Microsoft.Azure.Cosmos.ItemRequestOptions.ConsistencyLevel" /> for Azure Cosmos DB is Session. In fact, this is the default level applied to accounts. <para> When working with Session consistency, each new write request to Azure Cosmos DB is assigned a new SessionToken. The DocumentClient will use this token internally with each read/query request to ensure that the set consistency level is maintained. <para> In some scenarios you need to manage this Session yourself; Consider a web application with multiple nodes, each node will have its own instance of <see cref="T:Microsoft.Azure.Cosmos.DocumentClient" /> If you wanted these nodes to participate in the same session (to be able read your own writes consistently across web tiers) you would have to send the SessionToken from <see cref="T:Microsoft.Azure.Cosmos.ItemResponse`1" /> of the write action on one node to the client tier, using a cookie or some other mechanism, and have that token flow back to the web tier for subsequent reads. If you are using a round-robin load balancer which does not maintain session affinity between requests, such as the Azure Load Balancer, the read could potentially land on a different node to the write request, where the session was created. </para><para> If you do not flow the Azure Cosmos DB SessionToken across as described above you could end up with inconsistent read results for a period of time. </para></para></remarks> </Docs> </Member> </Members> </Type>