【发布时间】:2017-12-20 09:07:59
【问题描述】:
有没有办法从 Microsoft Graph 获取 n 个最新列表项或一年内创建的项?
到目前为止我已经尝试过:
// .Filter("CreatedDateTime gt 2016-12-18T14:13:30Z")
var news = client.Sites[Root]
.SiteWithPath(path)
.Lists[newsListId]
.Items
.Request()
.Filter("CreatedDateTime gt 2016-12-18T14:13:30Z")
.GetAsync()
.Result;
// => The request is malformed or incorrect.
// .OrderBy("CreatedDateTime desc")
var news = client.Sites[Root]
.SiteWithPath(path)
.Lists[newsListId]
.Items
.Request()
.OrderBy("CreatedDateTime desc")
.GetAsync()
.Result;
// => returns data but not in the requested order
//.Filter("year(CreatedDateTime) eq 2017")
var news = client.Sites[Root].SiteWithPath(path)
.Lists[newsListId]
.Items
.Request()
.Filter("year(CreatedDateTime) eq 2017")
.GetAsync()
.Result;
// => ServiceException: Code: itemNotFound
// Message: The resource could not be found.
【问题讨论】:
标签: sharepoint microsoft-graph-api