所有記錄使用此代碼塊獲取從蔚藍的表存儲
try
{
StorageCredentials creds = new StorageCredentials(accountName, accountKey);
CloudStorageAccount account = new CloudStorageAccount(creds, useHttps: true);
CloudTableClient client = account.CreateCloudTableClient();
CloudTable table = client.GetTableReference("serviceAlerts");
TableOperation retrieveOperation = TableOperation.Retrieve<ServiceAlertsEntity>("ServiceAlerts", "b9ccd839-dd99-4358-b90f-46781b87f933");
TableResult query = table.Execute(retrieveOperation);
if (query.Result != null)
{
outline = outline + ((ServiceAlertsEntity) query.Result).alertMessage + " * ";
}
else
{
Console.WriteLine("No Alerts");
}
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
我能夠檢索與在檢索中提到的分區和rowkey單個記錄。
有沒有一種方法可以獲取存儲在ServiceAlerts分區中的所有記錄?
我已經嘗試了第二個參數
TableOperation retrieveOperation = TableOperation.Retrieve<ServiceAlertsEntity>(
"ServiceAlerts","b9ccd839-dd99-4358-b90f-46781b87f933");
一個通配符(*),但它不返回任何東西。
table.ExecuteQuery返回一個IEnumerable,這意味着它會在多個分區服務器將所有數據。這種方法不好 –