sitecore 中 item.Axes.GetDescendants() 和 item.Axes.selectitems() 之间的根本区别是什么

What is fundamental difference between item.Axes.GetDescendants() and item.Axes.selectitems() in sitecore

sitecore 中 item.Axes.GetDescendants()item.Axes.selectitems() 的 fundamental/Performance 区别是什么?

item.Axes.GetDescendants() 使用 Sitecore API 获取 item 的所有后代。它调用 item.Children,然后对每个 child 再次递归调用 child.Children。并将所有这些项目添加到一个数组中。

item.Axes.Selectitems(string query) 在当前项的上下文中执行参数中传递的 Sitecore 查询。

所以这两种方法是完全不同的。

item.Axes.selectitems() 根据查询选择项目 provided.It 在 sitecore 中使用 item.Axes.selectitems() 总是个好主意 而不是 GetDescendents,因为 Get Descendents 始终以递归方式获取子项,如果子项很大,则会对性能造成巨大影响。