You are viewing limited content. For full access, please sign in.

Question

Question

How to iterate though an AssignedTagCollection with RA?

asked on December 16, 2014 Show version history
List<TagInfo> securityTags = new List<TagInfo>();
AssignedTagCollection tagCollection = null;

TrusteeInfo trustee = Trustee.GetInfo(new AccountReference(userName, LFSession), LFSession);
tagCollection = trustee.Tags;

foreach (AssignedTag tag in tagCollection)
{
       if (tag.IsSecure == true) securityTags.Add((TagInfo)tag);
}

return securityTags;

The assigned tags can not be converted to TagInfo. So I get the same error if I do: 'foreach (TagInfo tag in tagCollection)'. This probably has an easy solution, but my brain isn't working today. I know I could just return a list of id's or strings, but I would rather return a list of TagInfo.

0 0

Answer

SELECTED ANSWER
replied on December 16, 2014
foreach (AssignedTag tag in tagCollection)
{
    TagInfo ti = Tag.GetInfo(tag.TagName, LFSession);
     if (ti.IsSecure == true) securityTags.Add((ti));
}

This is what I've come up with, but I am open to better ideas.

1 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.