title: Switch case in C# - a constant value is expected
body: <p>My code is as follows:</p>
  
  <pre><code>public static void Output&lt;T&gt;(IEnumerable&lt;T&gt; dataSource) where T : class
  {   
      dataSourceName = (typeof(T).Name);
      switch (dataSourceName)
      {
          case (string)typeof(CustomerDetails).Name.ToString(); :
              var t = 123;
              break;
          default:
              Console.WriteLine("Test");
      }
  }
  </code></pre>
  
  <p>But this is not working. The case statement is giving me an error saying that a constant variable is expected. Please help guys thank you!</p>