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
<PackageReference Include="Soenneker.Cosmos.RequestOptions" Version="4.0.176" />
<PackageVersion Include="Soenneker.Cosmos.RequestOptions" Version="4.0.176" />
<PackageReference Include="Soenneker.Cosmos.RequestOptions" />
paket add Soenneker.Cosmos.RequestOptions --version 4.0.176
#r "nuget: Soenneker.Cosmos.RequestOptions, 4.0.176"
#:package Soenneker.Cosmos.RequestOptions@4.0.176
#addin nuget:?package=Soenneker.Cosmos.RequestOptions&version=4.0.176
#tool nuget:?package=Soenneker.Cosmos.RequestOptions&version=4.0.176
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 | Versions 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. |
-
net10.0
- Microsoft.Azure.Cosmos (>= 3.62.1)
- Newtonsoft.Json (>= 13.0.4)
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 |
Isolate shared Cosmos request options