u012789878
记忆留樱
2015-10-15 10:15

从azure storage上取出的数据如果数据记录为0时进行ToList()时出错。

5
  • azure

从azure storage上取出的数据如果数据记录为0时进行ToList()时出错。
public IEnumerable RetrieveTableEntitiesInCondition(string tableName, string conditions) where TEntity : ITableEntity, new()
{
IEnumerable entities = null;
try
{
CloudTable table = tableClient.GetTableReference(tableName);
TableQuery query = new TableQuery().Where(conditions);
entities = table.ExecuteQuery(query);
}
catch (Exception ex)
{
logger.Warn("Retrieve condition entity failed: {0}.", ex.ToString());
}
return entities;
}
当该数据记录为0时对该结果进行ToList()操作时抛出异常,异常为:The remote server returned an error: (404) Not Found. Microsoft.WindowsAzure.Storage.StorageException: The remote server returned an error: (404) Not Found. ---> System.Net.WebException: The remote server returned an error: (404) Not Found.
at System.Net.HttpWebRequest.GetResponse()
求大神帮忙解答为什么ToList()操作会抛出这么个异常。

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答