Which code segment should you use?

You need to create a Web Part that displays all social tags entered by users.

Which code segment should you use?

You need to create a Web Part that displays all social tags entered by users.

Which code segment should you use?

A.
TaxonomySession session = new TaxonomySession(SPContext.Current.Site);
TermSet socialTags = session.DefaultKeywordsTermStore.SystemGroup.TermSets[“Keywords”];

B.
TaxonomySession session = new TaxonomySession(SPContext.Current.Site);
TermSet socialTags = session.DefaultKeywordsTermStore.SystemGroup.TermSets[“Tags”];

C.
TermSet socialTags = (TermSet)SPContext.Current.Site.WebApplication.Properties[“Tags”];

D.
TermSet socialTags = (TermSet)SPContext.Current.Web.AllProperties[“Keywords”];

Explanation:
MNEMONIC RULE: “TaxonomySession, TermSets[“Keywords”]”

TermSetCollection Members
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.taxonomy.termsetcollection_members.aspx

IndexedCollection<T>.Item Property (String)
http://msdn.microsoft.com/en-us/library/ee580616.aspx



Leave a Reply 0

Your email address will not be published. Required fields are marked *