title: C# how to search in Dictionary key by array of tags
body: <p>I am learning c# and I am trying something simple: inputing some tags separated by comma the code to return a message. The idea is that the code should filter by all the tags that I am splitting into an array.</p>
  
  <p>Defining the variables:</p>
  
  <pre><code>Dictionary&lt;string[], string&gt; messages = new Dictionary&lt;string[], string&gt;();
  messages.Add(new string[] { "greeting", "hello", "hei", "hi" }, "Hello!");
  messages.Add(new string[] { "greeting", "bye", "buh-bye", "sayonara" }, "Bye!");
  </code></pre>
  
  <p>Getting the tag:</p>
  
  <pre><code>string[] tags;
  tags.Add("greeting");
  tags.Add("hello");
  </code></pre>
  
  <p>The list and iterating:</p>
  
  <pre><code>List&lt;string&gt; lista = new List&lt;string&gt;();
  foreach(string tag in e.GetArg("Tag").Split(','))
  {
      foreach (KeyValuePair&lt;string[], string&gt; entry in gifs)
      {
          if (entry.Key.Contains(tag))
          {
              lista.Add(entry.Value);
          }
      }
  }
  </code></pre>
  
  <p>The problem with this is that it adds every met item for each tag in the <strong>list</strong>, even the bye item. Can I filter this with an array of tags? Or I need to pass it more times, each time getting the desired one(s)?</p>