title: How to switch case over an List<string> in C#
body: <p>I want to do a <code>switch case</code> over a <code>List&lt;string&gt;</code> in C#.</p>
  <p>Let's say I have the following list:</p>
  <pre><code>var myList = new List&lt;string&gt;(new string[] { &quot;Apple&quot;, &quot;Pear&quot; });
  </code></pre>
  <p>Now I wanna check if Apple or Pear and then do something. In an <code>if statement</code> it would look like this:</p>
  <pre><code>if (myList.Contains(&quot;Apple&quot;))
     //do something
  else if (myList.Contains(&quot;Pear&quot;))
     //so some other thing
  else
     //throw error
  </code></pre>
  <p>Now how can I do this in an clean way as a <code>switch statement</code>?</p>