Skip to content

Instantly share code, notes, and snippets.

@i3arnon
Created October 6, 2015 21:20
Show Gist options
  • Save i3arnon/291dab03830eadeaa9ff to your computer and use it in GitHub Desktop.
Save i3arnon/291dab03830eadeaa9ff to your computer and use it in GitHub Desktop.
static void Main()
{
OuterOperationAsync().Wait();
}
static async Task OuterOperationAsync()
{
Console.WriteLine(LogicalFlow.CurrentOperationId);
using (LogicalFlow.StartScope())
{
Console.WriteLine("\t" + LogicalFlow.CurrentOperationId);
await InnerOperationAsync();
Console.WriteLine("\t" + LogicalFlow.CurrentOperationId);
await InnerOperationAsync();
Console.WriteLine("\t" + LogicalFlow.CurrentOperationId);
}
Console.WriteLine(LogicalFlow.CurrentOperationId);
}
static async Task InnerOperationAsync()
{
using (LogicalFlow.StartScope())
{
await Task.Yield();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment