Please take a look at the following code:
Public Sub Method(Of TEntity As EntityObject)(ByVal entity As TEntity)
If TypeOf entity Is Contact Then
Dim contact As Contact = entity Compile error
Dim contact = DirectCast(entity, Contact) Compile error
Dim contact = CType(entity, Contact) Compile error
End If
End Sub
Any ideas?