1

In managed metadata service term store, I am iterating through all the groups, all termSets and all terms up to last level. I can iterate through group, termSet and root term (test1.1 in example below). In my case I have 4 or even more levels of terms, how i get to know if it is last term in terms hierarchy. which property or method will give this information? For example in below terms hierarchy how I get to know the last term programmatically? For example test1.1.1

enter image description here

1 Answer 1

1

You can make use of properties Terms or TermsCount. This property provides the list of immediate Terms. So in your case you can use following logic

if(term.Terms == null || term.Terms.Count == 0)
    //means this term has no childern

if(term.TermsCount == 0)
    //means this term has no childern

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.