public List <LocalTermStore> FetchTermStores() { TaxonomySession taxonomySession = this.GetTaxonomySession(); ClientConnectorDownloadOptions options = new ClientConnectorDownloadOptions(); options.MaximumDepth = 0; options.MinimalAtMaximumDepth = true; var retrievals = TermStoreDownloader.GetRetrievalsForMinimalProperties(); this.clientContext.Load(taxonomySession, session => session.TermStores.Include(retrievals)); this.ExecuteQuery(); List <LocalTermStore> list = new List <LocalTermStore>(); foreach (TermStore clientTermStore in taxonomySession.TermStores) { var downloaderContext = new TaxonomyItemDownloaderContext(this, options); TermStoreDownloader termStoreDownloader = new TermStoreDownloader(downloaderContext, clientTermStore); termStoreDownloader.AssignMinimalProperties(); list.Add(termStoreDownloader.LocalObject); } return(list); }
protected override void QueryMinimalProperties() { this.ClientContext.Load(this.ClientTermStore, TermStoreDownloader.GetRetrievalsForMinimalProperties()); }