通过分区和行键检索数据时获取null

时间:2018-06-16 16:35:32

标签: c# azure-table-storage

public T GetSingle<T>(string PartitionKey, string RowKey) where T : TableEntity
{
    // Create a retrieve operation that takes a customer entity.
    TableOperation retrieveOperation = TableOperation.Retrieve<T>(PartitionKey, RowKey);

    // Execute the retrieve operation.
    TableResult retrievedResult = table.Execute(retrieveOperation);  
}

我的retrieveResult总是空着。我有表referance.Please帮我找到我的问题。

1 个答案:

答案 0 :(得分:-1)

AFAIK,PartitionKeyRowKey的值区分大小写。请确保PartitionKeyRowKey的值与您存储的实体完全匹配。此外,您可以在执行表查询时利用Fiddler捕获网络跟踪以缩小此问题的范围。对于常见教程,您可以关注Get started with Azure Table storage and the Azure Cosmos DB Table API using .NET