Soenneker.Cosmos.RequestOptions
11.0.200
Prefix Reserved
dotnet add package Soenneker.Cosmos.RequestOptions --version 11.0.200
NuGet\Install-Package Soenneker.Cosmos.RequestOptions -Version 11.0.200
<PackageReference Include="Soenneker.Cosmos.RequestOptions" Version="11.0.200" />
<PackageVersion Include="Soenneker.Cosmos.RequestOptions" Version="11.0.200" />
<PackageReference Include="Soenneker.Cosmos.RequestOptions" />
paket add Soenneker.Cosmos.RequestOptions --version 11.0.200
#r "nuget: Soenneker.Cosmos.RequestOptions, 11.0.200"
#:package Soenneker.Cosmos.RequestOptions@11.0.200
#addin nuget:?package=Soenneker.Cosmos.RequestOptions&version=11.0.200
#tool nuget:?package=Soenneker.Cosmos.RequestOptions&version=11.0.200
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 | net11.0 is compatible. |
-
net11.0
- Microsoft.Azure.Cosmos (>= 3.64.0)
- 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 |
|---|---|---|
| 11.0.200 | 0 | 11/7/2026 |
| 11.0.199 | 43 | 11/6/2026 |
| 11.0.198 | 1,423 | 10/27/2026 |
| 11.0.197 | 290 | 10/27/2026 |
| 11.0.196 | 272 | 10/26/2026 |
| 11.0.195 | 282 | 10/26/2026 |
| 4.0.194 | 1,045 | 10/14/2026 |
| 4.0.193 | 94 | 10/14/2026 |
| 4.0.188 | 348 | 10/12/2026 |
| 4.0.187 | 206 | 10/12/2026 |
| 4.0.186 | 609 | 10/11/2026 |
| 4.0.185 | 1,337 | 9/30/2026 |
| 4.0.184 | 93 | 9/30/2026 |
| 4.0.182 | 165 | 9/30/2026 |
| 4.0.181 | 1,314 | 9/24/2026 |
| 4.0.180 | 719 | 9/18/2026 |
| 4.0.179 | 693 | 9/15/2026 |
| 4.0.178 | 975 | 9/12/2026 |
| 4.0.177 | 716 | 9/9/2026 |
| 4.0.176 | 2,961 | 8/30/2026 |
Update dependency Microsoft.Azure.Cosmos to 3.64.0 (#821)