public static bool IsInteger64(this Type type) { type = GetNonNullableType(type); if (type.GetTypeInfo().IsEnum) { return false; } switch (type.GetTypeCode()) { case TypeCode.Int64: case TypeCode.UInt64: return true; default: return false; } }