Mimicking JavaScript generators/co in C#