using System; using System.Linq; using System.Collections.Generic; using System.Collections.Concurrent; using System.Reflection; using System.Linq.Expressions; using System.Threading; using System.Threading.Tasks; var local = new AsyncLocal(); local.Value = "root"; Task work; using (ExecutionContext.SuppressFlow()) { work = Task.Run(() => local.Value ?? "none"); } Console.WriteLine($"worker:{await work}"); await Task.CompletedTask.ConfigureAwait(false); Console.WriteLine($"parent:{local.Value}"); Console.WriteLine($"suppressed:{ExecutionContext.IsFlowSuppressed()}");