Esempio n. 1
0
        public string GetWikiPageByIdText()
        {
            VssConnection  connection = this.Context.Connection;
            WikiHttpClient wikiClient = connection.GetClient <WikiHttpClient>();

            WikiV2 wiki       = Helpers.FindOrCreateProjectWiki(this.Context);
            int    somePageId = Helpers.GetAnyWikiPageId(this.Context, wiki);

            using (var reader = new StreamReader(wikiClient.GetPageByIdTextAsync(
                                                     project: wiki.ProjectId,
                                                     wikiIdentifier: wiki.Id,
                                                     id: somePageId).SyncResult()))
            {
                string pageContent = reader.ReadToEnd();
                Context.Log("Retrieved page with id : '{0}' in wiki '{1}' with content '{2}'", somePageId, wiki.Name, pageContent);

                return(pageContent);
            }
        }