title: How to use a switch statement with Guid?
body: <p>In the following C# code, cboRole returns a Guid.</p>
  
  <p>I'm then trying to use it in a switch statement to do some actions. </p>
  
  <p>cboRole can return only 4 different Guid so I think a switch is a good option for me.</p>
  
  <p>The thing is that all the case are ignored and I always get the default action. When I debug I clearly see that cboRole return a value like in the following printscreen.</p>
  
  <p>What is the correct way to "compare" Guids in a C# switch statement</p>
  
  <p>Code:</p>
  
  <pre><code>if (!cboRole.IsNull)
  {
      switch (cboRole.EditValue.ToStringEx())
          {
              case "532E8EED-9E72-42E0-871E-36470C1AE327":
                  param1 = "4E08BA7C-E81F-40AE-92F0-DF33A98DD0BB";
                  MessageBox.Show("It's working");
                  break;
              case "FA7637E9-A9E4-4D57-A59B-80615424D27F":
                  param1 = "E540C382-F22C-4FE2-9068-1E10AA8DD076";
                  break;
              case "2734CCD9-93E6-4A86-8B83-5EA9E62FA921":
                  param1 = "8A54F8D5-5B74-4B3F-A29A-D423AA8DD02E";
                  break;
              default:
                  MessageBox.Show("Not Working");
                  break;
          }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/QIlrc.png" alt="Debug Print Screen"></p>