Programmatically getting the metadata information

 SPSite site = new SPSite("http://myserver");
                TaxonomySession txSesssion = new TaxonomySession(site);
                foreach (TermStore store in txSesssion.TermStores)
                {
                    foreach (Group g in store.Groups)
                    {
                        if (g.Name == "GROUP1")
                        {
                            foreach (TermSet tSet in g.TermSets)
                            {
                                if (tSet.Name == "termset1")
                                {
                                    Console.WriteLine("......TermSET : " + tSet.Name);
                                    foreach (Term t in tSet.Terms)
                                    {
                                        Console.WriteLine("TERM :" + t.Name);
                                    }
                                }
                            }
                        }
                    }
                }

Comments

Popular posts from this blog

IRM and the Object Model

This content database has a schema version which is not supported in this farm

Activate and Deactivate Feature through PowerShell