Stack<Action> stack = new Stack<Action>(); stack.Push(()=>{Console.Write("executed");}); while (stack.Count>0){ stack.Pop().Invoke(); }