下面是我用来获取数据的示例。请根据您的情况尝试下面的查询。我觉得应该管用。
public async Task<Advertisement> GetAdvertisementBy(string id, string user)
{
List<Advertisement> list = new List<Advertisement>();
// Initialize the continuation token to null to start from the beginning of the table.
TableContinuationToken continuationToken = null;
var filter1 = TableQuery.GenerateFilterCondition("PartitionKey", QueryComparisons.Equal, user);
var filter3 = TableQuery.GenerateFilterCondition("RowKey", QueryComparisons.Equal, id);
var combine = TableQuery.CombineFilters(filter1, TableOperators.And, filter3);
TableQuery<Advertisement> query = new TableQuery<Advertisement>().Where(combine);
do
{
// Retrieve a segment (up to 1,000 entities).
TableQuerySegment<Advertisement> tableQueryResult = await base.Table.ExecuteQuerySegmentedAsync(query, continuationToken);
// Assign the new continuation token to tell the service where to
// continue on the next iteration (or null if it has reached the end).
continuationToken = tableQueryResult.ContinuationToken;
list.AddRange(tableQueryResult.Results);
// Loop until a null continuation token is received, indicating the end of the table.
} while (continuationToken != null);
return list.FirstOrDefault();
}