【发布时间】:2015-11-17 14:41:06
【问题描述】:
在 Microsoft Azure DocumentDb 中,如何检索所有数据库的列表?不是特定数据库中的文档,而是特定帐户的所有数据库。最好使用标准的DocumentClient 类。
【问题讨论】:
标签: c# azure azure-cosmosdb
在 Microsoft Azure DocumentDb 中,如何检索所有数据库的列表?不是特定数据库中的文档,而是特定帐户的所有数据库。最好使用标准的DocumentClient 类。
【问题讨论】:
标签: c# azure azure-cosmosdb
你可以像下面这样:
using (var documentClient = new DocumentClient(new Uri("<endpoint>"), "<accountkey>"))
{
var listDatabasesOperationResult = await documentClient.ReadDatabaseFeedAsync();
foreach (var item in listDatabasesOperationResult)
{
Console.WriteLine(item.Id);
}
}
【讨论】:
An exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll but was not handled in user code -- 我想知道为什么?