public void MoveNext() { if (state == 0) { awaiter = CustomAsync().GetAwaiter(); if (!awaiter.IsCompleted) { state = 1; awaiter.OnCompleted(MoveNext); return; } } string result = awaiter.GetResult(); Console.WriteLine(result); }
private static void TheRest(MyAwaitableType.MinimalAwaiter awaiter) { string result = awaiter.GetResult(); Console.WriteLine(result); }