gpt4 book ai didi

sharepoint-2010 - 可查询负载如何在 SharePoint 中工作?

转载 作者:行者123 更新时间:2023-12-04 05:21:14 25 4
gpt4 key购买 nike

当 LINQ 用于检索 SharePoint 对象时,任何人都可以帮助我了解幕后的工作类型。对于 example ,我可以使用这样的代码:

private IEnumerable<List> newLists;

var dt = new DateTime(2010, 3, 20);
var query = from list
in clientContext.Web.Lists
where list.Created > dt && list.Hidden == false
select list;

newLists = clientContext.LoadQuery(query);
clientContext.ExecuteQuery();

它是如何工作的?

请求看起来如何?

来自 documentation我发现:

When you use the CSOM, you can write LINQ queries against client-side objects, such as lists and Webs, and then use the ClientContext class to submit these queries to the server. It's important to understand that when you take this approach, you are using LINQ to Objects to query SharePoint objects, not LINQ to SharePoint. This means that your LINQ expressions are not converted to CAML and you will not see the performance benefits that are associated with CAML conversion.



所以,我有点困惑,因为我认为,LINQ 表达式转换为 Caml 请求。我无法理解它是如何工作的。如何在执行 ExecuteQuery() 时查看请求的详细信息方法?你能向我推荐任何观看请求的工具吗?

最佳答案

SP 在内部使用 CAML:SP 运行时将 Linq 转换为 CAML 并通过 Soap 请求或 REST 语句(如果您使用的是 RESTful 服务)发送:http://msdn.microsoft.com/en-us/library/ff798339.aspx (有例子);

在此处查看更多信息:
http://msdn.microsoft.com/en-us/library/ff798464.aspx

这可能会有所帮助:http://nikspatel.wordpress.com/2012/08/05/sharepoint-2010-data-querying-options-server-om-vs-client-om-vs-rest-vs-linq-vs-search-api/

关于sharepoint-2010 - 可查询负载如何在 SharePoint 中工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13667324/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com