When you get the type of the variable, you can check its name:
if (my_type.Name=="Int32")
however it would be more elegant to write
if (my_type.Name==TypeNames.Int32)
to avoid typos. I can define such a class on my own, but maybe there is a definition somewhere?
If yes, where?
Note . Please avoid asking yourself: βWhy do you want to get the type of a variable in the first place,β βitβs better to use aβ have, βetc. Thank you so much!
Edit : in the meantime, I jumped to the conclusion, it would be enough to ignore the type of the object (the variable my_type) and instead check the object. In other words, my_type is not required. I forgot about the null case :-( Less code, more sleep, what I need ;-)