count data received from API

Hi all,

I'm creating a reactive web app & trying to do pagination on it. I know how to count data receiving from an aggregate but data receiving from an API is something different.

How should I do it? Is there any Demo that is available on learning platform to do this for reactive web application? I'm searching it for a while now & couldn't  find it.

Regards

Sahil

Solution

Hello Sahil,

Hope you're doing well.

It seems that your GetData data action is returning 2 different lists: StatewiseCases (List of StatewiseCase) and DailyCases (List of DailyCase).

If you want to get the TotalCount (total records of the list), you can use the Length property of the list:

GetData.StatewiseCases.Length

or

GetData.DailyCases.Length

depending on the list that you're working with.


This property will return the total number of the records of the list, which is exactly what you want as a TotalCount.


Kind regards,

Rui Barradas

Solution

Thanks Rui


Regards 

Sahil

You're most welcome Sahil.


Kind regards,

Rui Barradas