public static bool IsUnsignedInt(this Type type) { type = GetNonNullableType(type); if (!type.GetTypeInfo().IsEnum) { switch (type.GetTypeCode()) { case TypeCode.UInt16: case TypeCode.UInt32: case TypeCode.UInt64: return true; } } return false; }