For a Type, there is a property IsClass, but how to know a Type is a struct?
Sorry, I have to add some more information.
IsValueType is a necessary condition, it is obviously not enough. For an Integer is a value type also.
t.IsValueType && !t.IsPrimitive && !t.IsEnum;
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