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);
}
}
}
}
}
}
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
Post a Comment