using System; using System.Linq; using System.Collections.Generic; using System.Collections.Concurrent; using System.Reflection; using System.Linq.Expressions; using System.Threading; using System.Threading.Tasks; Console.WriteLine("before"); Console.WriteLine($"first:{Counter.Next()}"); Console.WriteLine($"second:{Counter.Next()}"); static class Counter { private static int value; static Counter() { Console.WriteLine("init"); value = 2; } public static int Next() => ++value; }