I have the following VB.NET function, for example:
Public Function MyFunction (Of TData) (ByVal InParam As Integer) As TData
End Sub
How do I, in a function, determine if TData is a NULLable Type?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
One way is:
… at least, the C# is:
That’s assuming you’re asking whether it’s a nullable value type. If you’re asking whether it’s a nullable value type or a class then the C# version would be:
but I’m not sure whether a simple VB translation would work there, as “Nothing” is slightly different in VB.