title: How can I use the string value of a C# enum value in a case statement?
body: <p>I have defined a C# enum as</p>
  
  <pre><code>public enum ORDER
  {
      ...
      unknown,
      partial01,
      partial12,
      partial23,
  }
  </code></pre>
  
  <p>and can use its value as a string as in:</p>
  
  <pre><code>            string ss = ORDER.partial01.ToString();
  </code></pre>
  
  <p>However when I try to use it in a case statement it fails to compile:</p>
  
  <pre><code>string value = ...
  switch (value)
  {
      case null:
          break;
      case "s":
          // OK
          break;
      case ORDER.partial01.ToString():
          // compiler throws "a constant value is expected"
  
          break;
    ...
  </code></pre>
  
  <p>I thought enums were constants. How do I get around this?</p>
  
  <p>(I cannot parse the value into an enum as some of the values are outside the range)</p>