skb
skb

Reputation: 31104

In C#, can I use reflection to determine if an enum type is int, byte, short, etc?

Is this possible? I can't find it anywhere.

Upvotes: 28

Views: 4103

Answers (1)

Andrew Hare
Andrew Hare

Reputation: 351526

Try this:

Enum.GetUnderlyingType(typeof(YourEnum))

Upvotes: 49

Related Questions