Пожалуйста, посмотрите на следующий код:
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
Есть идеи?