Soenneker.Cosmos.RequestOptions 4.0.176

Prefix Reserved
dotnet add package Soenneker.Cosmos.RequestOptions --version 4.0.176
                    
NuGet\Install-Package Soenneker.Cosmos.RequestOptions -Version 4.0.176
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.Cosmos.RequestOptions" Version="4.0.176" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Cosmos.RequestOptions" Version="4.0.176" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Cosmos.RequestOptions" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Cosmos.RequestOptions --version 4.0.176
                    
#r "nuget: Soenneker.Cosmos.RequestOptions, 4.0.176"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.Cosmos.RequestOptions@4.0.176
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Cosmos.RequestOptions&version=4.0.176
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Cosmos.RequestOptions&version=4.0.176
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.Cosmos.RequestOptions

Small factory properties for common Azure Cosmos DB request-option configurations.

Installation

dotnet add package Soenneker.Cosmos.RequestOptions

Suppress write response content

ItemResponse<OrderDocument> response = await container.CreateItemAsync(
    order,
    new PartitionKey(order.PartitionKey),
    CosmosRequestOptions.ExcludeResponse,
    cancellationToken);

ExcludeResponse returns an ItemRequestOptions instance with EnableContentResponseOnWrite = false. This reduces response payload work when the caller does not need Cosmos to return the stored resource. The resulting ItemResponse<T>.Resource may be absent; keep using the document passed to the write when needed.

Request one item per query page

using FeedIterator<OrderDocument> iterator = container.GetItemQueryIterator<OrderDocument>(
    queryDefinition,
    requestOptions: CosmosRequestOptions.MaxItemCountOne);

MaxItemCountOne returns a QueryRequestOptions instance with MaxItemCount = 1. It limits the requested page size; it does not add TOP 1 to the query or guarantee that Cosmos will produce exactly one item on every page.

Each property access returns a new mutable SDK options object, so callers can customize it without changing another request:

QueryRequestOptions options = CosmosRequestOptions.MaxItemCountOne;
options.PartitionKey = new PartitionKey("tenant-42");

No dependency-injection registration or application configuration is required.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Soenneker.Cosmos.RequestOptions:

Package Downloads
Soenneker.Cosmos.Repository

A data persistence abstraction layer for Cosmos DB

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.176 936 8/30/2026
4.0.175 131 8/29/2026
4.0.174 2,892 8/7/2026
4.0.173 1,380 7/27/2026
4.0.172 1,281 7/17/2026
4.0.171 670 7/16/2026
4.0.170 2,929 6/18/2026
4.0.169 2,568 6/5/2026
4.0.168 111 6/5/2026
4.0.167 1,186 5/19/2026
4.0.166 1,566 4/25/2026
4.0.165 663 4/22/2026
4.0.164 1,753 3/20/2026
4.0.163 1,229 3/12/2026
4.0.162 126 3/12/2026
4.0.161 118 3/12/2026
4.0.160 135 3/12/2026
4.0.159 1,598 3/10/2026
4.0.158 509 3/9/2026
4.0.157 218 3/9/2026
Loading failed

Isolate shared Cosmos request options