title: C# - Get switch value if in default case
body: <p>Help please, I have this case:</p>
  
  <pre><code>switch(MyFoo()){
      case 0: //...
          break;
      case 1: //...
          break;
      case 2: //...
          break;
      default:
          // &lt;HERE&gt;
          break;
  }
  </code></pre>
  
  <p>As you can see the switch gets the value directly from a method without saving it as a variable.</p>
  
  <p>Is it possible to get which value fires the <code>default</code> case? 
  For example if <code>MyFoo()</code> returns 7, how can I get that value?</p>
  
  <p>I want to avoid to save the method result as a variable, is there a way to get the switch value from inside a case? Something like this:</p>
  
  <pre><code>default:
      this.SwitchValue // &lt;&lt;--
      break;
  </code></pre>
  
  <p>Thank you for reading,
  ~Saba</p>