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");
 
            // Group GUID
            Guid guid = new Guid("1e6de19d-32db-4a86-86b2-0767658f9b08");
 
            // Get the term group using GUID
            TermGroup termGroup = termStore.GetGroup(guid);
 
            // Delete the term group
            termGroup.DeleteObject();
           
            // Execute the query to the server
            clientContext.ExecuteQuery();
           
        }
    }
}