简体   繁体   English

我可以使用LINQ从Quickbooks Online ServiceContext取回100多个记录吗?

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

For my Quickbooks Online integration, I'm using the .NET SDK and was previously using LINQ to access data from a ServiceContext : 对于我的Quickbooks Online集成,我使用.NET SDK,并且以前使用LINQ从ServiceContext访问数据:

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

When testing, we noticed that this only returns the first 100 records. 在测试时,我们注意到这仅返回前100条记录。 (Presumably because this is the default page size?) (大概是因为这是默认页面大小?)

We can get around this by using a query containing MAXRESULTS : 我们可以通过使用包含MAXRESULTS的查询来解决此MAXRESULTS

var itemsService = new QueryService<Item>(ServiceContext);
_items = itemsService.ExecuteIdsQuery("SELECT * FROM Item MAXRESULTS 1000").ToList();

My question is, can I achieve the same result without using a query string? 我的问题是,不使用查询字符串就可以达到相同的结果吗?

I must admit I have no idea what Quickbooks Online even is, but nevertheless I think you can override default page size with LINQ Take(yourPageSize) . 我必须承认,我什至不知道什么是Quickbooks Online,但是我认为您可以使用LINQ Take(yourPageSize)覆盖默认页面大小。 Though it's still not clear how to fetch ALL items in a collection this way, without knowing total count beforehand. 尽管目前尚不清楚如何以这种方式获取集合中的所有项目,而无需事先知道总数。 Hopefully you don't need to do this in your scenario (or if you do - maybe you can just use arbitrary large number for Take if you won't find another way). 希望您在您的场景中不需要这样做(或者,如果您这样做-如果您找不到其他方法,也许可以对Take使用任意大的数字)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我可以从PrincipalSearcher中获得1000条以上的记录吗? - Can I get more than 1000 records from a PrincipalSearcher? 我可以从 DirectorySearcher 中获取 1000 多条记录吗? - Can I get more than 1000 records from a DirectorySearcher? 我可以使用LINQ跳过集合并仅返回100条记录吗? - Can I use LINQ to skip a collection and just return 100 records? IntuIt QuickBooks付款API,如何使用IppDotNetSdkForQuickBooksApiV3软件包的servicecontext执行信用卡交易? - IntuIt QuickBooks payments API, How can I perform credit card transactions using servicecontext of IppDotNetSdkForQuickBooksApiV3 package? 如何使用LINQ简化(加速)从包含超过一百万条记录的数据库中选择查询 - How can I simplify (speed up) the selecting query from a database that contains more than 1 million records using LINQ 我可以使用Linq以比这更优雅的方式从集合中获取属性吗? - Can I get a property from a collection using Linq in a more elegant way than this? 从QuickBooks Online获取付款方式名称 - Get the Payment method name from QuickBooks Online 如何从Amazon Simple DB检索超过100条记录 - How to retrieve more than 100 Records from Amazon Simple DB 如何使用Task并行处理100多个文件 - How can I to use Task to deal with more than 100 files by parallel way 如何在C#中获得超过100个十进制数字? - How can I get more than 100 decimal digits in C#?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM