Count rows within partition in Azure table storage

后端 未结 5 990
余生分开走
余生分开走 2020-12-16 00:42

I\'ve seen various questions around SO about how to get the total row count of an Azure storage table, but I want to know how to get the number of rows with

5条回答
  •  青春惊慌失措
    2020-12-16 00:54

    I think you can directly use the .Count in C#. You can use either this technique:

    var tableStorageData = await table.ExecuteQuerySegmentedAsync(azQuery, null);
    int count = tableStorageData.Count();
    

    or

    TableQuery tableQuery = new TableQuery();
    var tableStorageData = table.ExecuteQuery(tableQuery,null);          
    count = tableStorageData .Count();
    

    The count variable will have the number total number of rows depending on the query.

提交回复
热议问题