How to check dictionary if string value exist for conditional comparison
<p>if I want use dictionary with given values for conditional comparison in if-statement to pass implementation but avoid if-statement for listing of this values and get it from dictionary. So how to check dictionary, which contains 400 strings, if string value exist:</p>

<pre><code>    Dictionary&lt;int, string&gt; set1 = new Dictionary&lt;int, string&gt;()
                              {{ 1, "string1" }, { 2, "string2" } ... }; // 400 values
</code></pre>

<p>So seems like this way is wrong: </p>

<pre><code>    string str = "string1";

    if (set1.ContainsKey(str) == true)
    {
         Console.WriteLine("Contains");
    }
    else
    {
         Console.WriteLine("Does Not Contains");
    }
</code></pre>

<p>To get result for further condition </p>