title: Unable to invoke a method with generic enum type as parameter
body: <p>I have a helper method which puts in spaces into enum names like below.</p>
  
  <pre><code> public static string GetListItemString(Enum listItem)
          {
              string result = string.Empty;
  
  #region ELegalStatus
              if (listItem is ELegalStatus)
              {
                  switch ((ELegalStatus) listItem)
                  {
                      case ELegalStatus.PrivateLimited:
                          result = "Private Limited";
                          break;
                      case ELegalStatus.PublicLimited:
                          result = "Public Limited";
                          break;
                     }
               }
  #endregion
  
  
  #region ERegion
              if (listItem is ERegion)
              {
                  switch ((ERegion) listItem)
                  {
                      case ERegion.EnglandandWales:
                          result = "England and Wales";
                          break;
                      case ERegion.NorthernIreland:
                          result = "Northern Ireland";
                          break;
                      case ERegion.Scotland:
                          result = "Scotland";
                          break;
                  }
              }
              #endregion 
  
        return result;
      }
  </code></pre>
  
  <p>And I am in the process of creating a method to convert an enum into list, which is as follows.</p>
  
  <pre><code>public static object EnumToList&lt;T&gt;()
          {
              Type enumType = typeof (T);
  
              // Can't use type constraints on value types, so have to do check like this
              if (enumType.BaseType != typeof (Enum))
              {
                  throw new ArgumentException("T must be of type System.Enum");
              }
  
              Array enumValArray = Enum.GetValues(enumType);
  
              foreach (var name in enumValArray)
              {
                  var y = Enum.Parse(enumType, name.ToString().Trim(), true);                
  
                 var x = ListHelper.GetListItemString(y);
  
              }
  
           return null;
  
          }
  </code></pre>
  
  <p>In the above method when all the names/values of a generic enum are read into the array, I would like to iterate though each of them and invoke the method 'GetListItemString' to get the properly spaced version of the name.</p>
  
  <p>But as 'GetListItemString' method only accepts a 'Enum' type it is not compiling.</p>
  
  <p>I am not sure how to pass in the required parameter for this method while iterating through the name/values of the enum.</p>
  
  <p>Could someone please help?</p>
  
  <p><strong>Update:</strong> I already tried using var x = ListHelper.GetListItemString((Enum) y);</p>
  
  <p>But the value of x is always empty when the 'EnumToList' method is invoked using EnumToList();</p>