你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

CosmosContainer.ReplaceContainerStreamAsync 方法

定义

ContainerProperties将 Azure Cosmos 服务中的 作为异步操作替换。

public abstract System.Threading.Tasks.Task<Azure.Response> ReplaceContainerStreamAsync (Azure.Cosmos.ContainerProperties containerProperties, Azure.Cosmos.ContainerRequestOptions requestOptions = default, System.Threading.CancellationToken cancellationToken = default);
abstract member ReplaceContainerStreamAsync : Azure.Cosmos.ContainerProperties * Azure.Cosmos.ContainerRequestOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response>
Public MustOverride Function ReplaceContainerStreamAsync (containerProperties As ContainerProperties, Optional requestOptions As ContainerRequestOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response)

参数

requestOptions
ContainerRequestOptions

(可选) 容器请求的选项 RequestOptions

cancellationToken
CancellationToken

(表示请求取消的可选) CancellationToken

返回

包含TaskResponse替换资源记录的 。

示例

ContainerProperties containerProperties = containerReadResponse;
containerProperties.IndexingPolicy.Automatic = false;
Response response = await container.ReplaceContainerStreamAsync(containerProperties);

适用于