title: Why is this code throwing an InvalidOperationException?
body: <p>I think that my code should make the <code>ViewBag.test</code> property equal to <code>"No Match"</code>, but instead it throws an <code>InvalidOperationException</code>.</p>
  
  <p>Why is this?</p>
  
  <pre><code>string str = "Hello1,Hello,Hello2";
  string another = "Hello5";
  string retVal = str.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)
                     .First(p =&gt; p.Equals(another));
  if (str == another)
  {
     ViewBag.test = "Match";
  }
  else
  {
     ViewBag.test = "No Match"; //this does not happen when it should
  }
  </code></pre>