SoFunction
Updated on 2025-03-07

Example of c# closure usage method


private static void Before()
        {
            Action[] actions = new Action[10];

            for (var i = 0; i < ; i++)
            {
                actions[i] = () =>
                {
                    (i);
                };
            }

            foreach (var item in actions)
            {
                item();
            }
        }