some simple types like int, string , ....are easy to realize that they are ValueTypes Or RefrenceTypes. But I wanna to know is there any way to distinguish?
All structs, enums and native types are value types.
At runtime you can check like this:
Type type = typeof(TypeName);
if (type.IsValueType)
{
//...
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With