public static bool IsEven()

in Older/ReSharper20181CSharp/ValueTracking/PatternMatching.cs [21:31]


        public static bool IsEven (object o)
        {
            switch (o)
            {
                case int i:
                case string s when int.TryParse (s, out i):
                    return i % 2 == 0;
                default:
                    throw new Exception ($"Cannot parse number from {o}.");
            }
        }