static Task Invoke(List<Func<Func<Task>, Task>> actions, int currentIndex = 0) { if (currentIndex == actions.Count) return Task.CompletedTask; var action = actions[currentIndex]; return action(() => Invoke(actions, currentIndex + 1)); }