using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.SharePoint.Client;
using Microsoft.SharePoint.Client.Taxonomy;
using System.Collections.ObjectModel;
namespace ManagedMetadataClient
{
class Program
{
static void Main(string[] args)
{
// ClienContext - Get the context for the SharePoint Site
// SharePoint site URL - http://c4968397007/
ClientContext clientContext = new ClientContext("http://c4968397007/");
// Get the TaxonomySession
TaxonomySession taxonomySession = TaxonomySession.GetTaxonomySession(clientContext);
// Get the term store by name
TermStore termStore = taxonomySession.TermStores.GetByName("MMS");
// Get the term group by Name
TermGroup termGroup = termStore.Groups.GetByName("SP2013");
// Get the term set by Name
TermSet termSet = termGroup.TermSets.GetByName("NewTermSet");
// Delete the term set
termSet.DeleteObject();
// Execute the query to the server
clientContext.ExecuteQuery();
}
}
}