I have an object parameter and I need to check if the object implements a specified interface in vb.net. How to test this?
Thanks.
I have an object parameter and I need to check if the object implements a specified interface in vb.net. How to test this?
Thanks.
Use TypeOf...Is:
If TypeOf objectParameter Is ISpecifiedInterface Then
'do stuff
End If
requiredInterface.IsAssignableFrom(representedType)
both requiredInterface and representedType are Types