How to get the row count from an azure database?

后端 未结 3 1060
暖寄归人
暖寄归人 2021-01-18 20:42

Am working on a windows store javascript application. The application uses data from azure mobile services. Consider the below code:



        
3条回答
  •  北海茫月
    2021-01-18 20:57

    If anybody comes here and interested in how to get the totalCount only on C# (like me), then this is how you do it:

    var table =  MobileService.GetTable ();
    var query = table.Take(0).IncludeTotalCount();
    IList results = await query.ToListAsync ();
    long count = ((ITotalCountProvider)results).TotalCount;
    

    Credit goes to this blog post here

提交回复
热议问题