我可以使用 LINQ 从 Quickbooks Online ServiceContext 获取超过 100 条记录吗?

Can I use LINQ to get more than 100 records back from a Quickbooks Online ServiceContext?

对于我的 Quickbooks Online 集成,我使用的是 .NET SDK,之前使用 LINQ 从 ServiceContext:

访问数据
var paymentMethodsService = new QueryService<PaymentMethod>(ServiceContext);
_paymentMethods = paymentMethodsService.Select(x => x).ToList();

测试时,我们注意到这只有 returns 前 100 条记录。 (大概是因为这是默认的页面大小?)

我们可以通过使用包含 MAXRESULTS:

的查询来解决这个问题
var itemsService = new QueryService<Item>(ServiceContext);
_items = itemsService.ExecuteIdsQuery("SELECT * FROM Item MAXRESULTS 1000").ToList();

我的问题是,我可以在不使用查询字符串的情况下获得相同的结果吗?

我必须承认我什至不知道 Quickbooks Online 是什么,但我认为您可以使用 LINQ Take(yourPageSize) 覆盖默认页面大小。尽管还不清楚如何在事先不知道总数的情况下以这种方式获取集合中的所有项目。希望你不需要在你的场景中这样做(或者如果你这样做 - 如果你找不到其他方法,也许你可以使用任意大的数字作为 Take)。