EventDay / Infusionsoft.net

A C# Wrapper around the Infusionsoft.com API
15 stars 22 forks source link

DataService.Count #41

Closed UserSud closed 7 years ago

UserSud commented 8 years ago

Hi I can't seem to find it but can someone point me to where I can tap into the Count methods please? I see it in https://developer.infusionsoft.com/docs/xml-rpc/#data-count-a-data-table-s-records But can't seem to find it here

Hope you can help

Many thanks!

hfloyd commented 7 years ago

Hi @UserSud, I also noticed the lack of the Count Methods. I'm not sure how this will work with large datasets, but I was able to get around it with code like this:

var recordsCount = _connectionClient.DataService.Query<TABLENAME>().Count();

ex: var tagsCount = _connectionClient.DataService.Query<ContactGroup>().Count();

UserSud commented 7 years ago

Hi @hfloyd Thanks for this. It works! But you're right depending on the size of the table it could take a while. I wonder if it's pulling the whole table over before giving the count :-(

Thanks for the code sample.

hfloyd commented 7 years ago

Glad to help, @UserSud :-)