似乎无法找到我的问题的答案。我正在使用 Google CSE,在结果集中,我希望获得“positiveVotes”大于 5 的所有项目。
我似乎无法理解如何获取 sub-sub-sub 属性满足条件的所有项目。它基本上假设是这样的:
results.Items
.Where(x => x.Pagemap.Where(a => a.Key == "discussion").Where(key == "positiveVotes" and value > 5)
但我真的不知道怎么写。请帮忙。
如果不提供 的确切类型,就很难准确理解您的数据结构是什么results
,但这是我对您需要的最佳猜测:
results.Items
.Where(x => x.Pagemap.ContainsKey("discussion")
&& x.PageMap["discussion"].Any(kvp => kvp.Key == "positiveVotes" && kvp.Value > 5))
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句