title: Method with a parameter that accepts Different types of Enum values
body: <p>I have a method that accepts Enum values as parameter, <a href="https://stackoverflow.com/a/1558878/4466640">this answer</a> is my reference. However I cant seem to make it work.</p>
  
  <p><strong>Enums</strong></p>
  
  <pre><code>Public Enum FieldTypes
      db_Alpha = 0
      db_Memo = 1
      db_Numeric = 2
  End Enum
  
  Public Enum SubTypes
      st_None = 0
      st_Phone = 35
      st_Percentage = 37
      st_Address = 63
      st_Link = 66
  End Enum
  </code></pre>
  
  <p><br>
  <strong>Method</strong></p>
  
  <pre><code>Public Sub Foo(Of T)(ByVal Param1 As String, ByVal EnumParam As T)
       Dim param As Type = GetType(T)
       If param.IsEnum Then
          Dim x = param.GetEnumValues()
       End If
       'Running some codes here
  End Sub
  </code></pre>
  
  <p><br>
  <strong>Main</strong></p>
  
  <pre><code>Public Sub Test()
      Foo("TestName",FieldTypes.db_Memo)
  End Sub
  </code></pre>
  
  <p>Im getting all the values of the type of Enum that was passed as a parameter. 
  I would want to reduce Method overloading and learn about generics here. Accepting C# and VB.net suggestions.</p>
  
  <ol>
  <li>How could I get the value of of the Enum item passed?</li>
  <li>How can I restrict this, that only the two types of Enum written is accepted?</li>
  </ol>