title: Casting Generic Types
body: <pre><code>Public Function CastToT(Of T)(ByVal GenericType(Of Object) data) As GenericType(Of T)
     Return DirectCast(data, GenericType(Of T))
  End Function
  </code></pre>
  
  <p>The above clearly does not work. Is there any way to perform this cast if I know that all objects inside data are in fact of Type T?</p>