コード例 #1
0
    public IEnumerable <SocialComment> RetrieveSharePointComments()
    {
        List <SocialComment> comments = new List <SocialComment>();

        using (SharePointContext sp = new SharePointContext(spSiteUrl, spUsername, spPassword))
        {
            // Retrieve comments from each item in the "News" SharePoint list
            var news  = sp.List("News");
            var items = sp.ListItems(news);

            foreach (var item in items)
            {
                var itemComments = sp.Comments(item);
                comments.AddRange(itemComments);
            }
        }

        return(comments);
    }