我有这个小代码来读取表格存储中的所有条目。这是我的简单模型:
public class LineEntity : TableServiceEntity
{
public XElement Data { get; set; }
public LineEntity(string rowKey)
{
PartitionKey = "Line";
RowKey = rowKey;
}
public LineEntity()
{
}
}
这是阅读它的代码:
var StorageAccount = CloudStorageAccount.Parse(RoleEnvironment.GetConfigurationSettingValue("StorageConnectionString"));
var TableClient = StorageAccount.CreateCloudTableClient();
var ServiceContext = TableClient.GetDataServiceContext();
var models = ServiceContext.CreateQuery<LineEntity>("lines").ToList();
由于某种原因,最后一行将在云中引发以下异常:
<?xml version="1.0" encoding="utf-8"?><Error><Code>OutOfRangeInput</Code><Message>One of the request inputs is out of range.
RequestId:8a16121a-237c-4015-99cb-b1bbdb7ab7a7
Time:2012-04-30T07:39:42.6396851Z</Message></Error>
它在开发中工作得非常好。这个有什么线索吗?
谢谢,