Loop inside a array within a dictionary
<p>Hi I have a quick question, which is the easiest way to loop inside an array that is within an object in a dictionary using C#?
The dictionary contain groups and groups have an array called tags, I have search for a tag and return a list of groups that contain that tag
I created a solution but it returns too many doubles when I apply it.</p>

<pre><code>    List&lt;Programme&gt; toReturn = new List&lt;Programme&gt;();
        // might need to ask getprogramme service to do the iteriation and retun a value
        foreach (Programme programme in programmes.Values)
        {

            if (message.Programme.Tags[0] != null)
            {
                int i;
                int u;

                foreach (KeyValuePair&lt;string, Programme&gt; entry in programmes)
                {
                    // for (i = 0; i &lt; message.Group.Tags.Length; i++)
                    for (i = 0; i &lt; entry.Value.Tags.Length; i++)
                    //foreach (string i in message.Group.Tags)
                    {
                        for (u = 0; u &lt; message.Programme.Tags.Length; u++)
                        {
                            // Compare the Name of the entry to the Name in the message (string comparison)
                            if (entry.Value.Tags[i].Equals(message.Programme.Tags[u]))
                            {
                                // If we found the group, set the return value and then break from the loop
                                toReturn.Add(programme);

                                break;
                            }


                        }
                    }
                }
            }
</code></pre>
