Soenneker.Cosmos.RequestOptions 11.0.201

Prefix Reserved
dotnet add package Soenneker.Cosmos.RequestOptions --version 11.0.201
                    
NuGet\Install-Package Soenneker.Cosmos.RequestOptions -Version 11.0.201
                    
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="11.0.201" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Cosmos.RequestOptions" Version="11.0.201" />
                    
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 11.0.201
                    
#r "nuget: Soenneker.Cosmos.RequestOptions, 11.0.201"
                    
#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@11.0.201
                    
#: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=11.0.201
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Cosmos.RequestOptions&version=11.0.201
                    
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 net11.0 is compatible. 
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
11.0.201 46 11/11/2026
11.0.200 487 11/7/2026
11.0.199 121 11/6/2026
11.0.198 1,734 10/27/2026
11.0.197 294 10/27/2026
11.0.196 274 10/26/2026
11.0.195 285 10/26/2026
4.0.194 1,059 10/14/2026
4.0.193 99 10/14/2026
4.0.188 350 10/12/2026
4.0.187 208 10/12/2026
4.0.186 612 10/11/2026
4.0.185 1,337 9/30/2026
4.0.184 95 9/30/2026
4.0.182 165 9/30/2026
4.0.181 1,315 9/24/2026
4.0.180 719 9/18/2026
4.0.179 695 9/15/2026
4.0.178 975 9/12/2026
4.0.177 716 9/9/2026
Loading failed

Upgrade .NET 11 release candidates to stable