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

CosmosDatabase.ReadStreamAsync(RequestOptions, CancellationToken) 方法

定义

DatabaseProperties以异步操作的形式从 Azure Cosmos 服务读取 。

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

参数

requestOptions
RequestOptions

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

cancellationToken
CancellationToken

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

返回

包含TaskResponse读取资源记录的 。

示例

//Reads a Database resource where
// - database_id is the ID property of the Database resource you wish to read.
Database database = this.cosmosClient.GetDatabase(database_id);
Response response = await database.ReadContainerStreamAsync();

适用于