title: C# 8 switch expression for void methods
body: <p>I'm aware of the <code>C# 8</code> <code>switch expression</code> syntax for methods that return a value or for property matching. But if we just need to switch on a string value and execute a method that returns nothing (no return type/void), then how do we go about it? I am thinking some form of Func but not sure of the exact syntax. I know we can do it the old way with regular case statements but was trying to see if we can achieve the same with the newer syntax.</p>
  
  <p>Here's the example of the problem</p>
  
  <pre><code>switch (stringvalue)
  {
      case "Add": Add(); break;
      case "Subtract": Subtract(); break;
  }
  </code></pre>
  
  <p>could be like:</p>
  
  <pre><code>stringvalue switch
  {
      "Add" =&gt; Add(),
      "Subtract" =&gt; Subtract()
  }
  // but this complains that there needs to be assignment on left side for this
  </code></pre>
  
  <p>Is this possible?</p>