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

Database.ReadStreamAsync(RequestOptions, CancellationToken) 方法

定义

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

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

参数

requestOptions
RequestOptions

(可选) 请求的选项。

cancellationToken
CancellationToken

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

返回

一个 TaskResponseMessage ,包含包含读取资源记录的 。

示例

// 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);
ResponseMessage response = await database.ReadContainerStreamAsync();

适用于