static async Task Main(string[] args) { Console.WriteLine("Hello World!"); await new Program().Method1(); Console.WriteLine($"Key Value [{AsyncLocalDictionary.GetLogicalValue<string>(key)}] should be null"); Console.ReadKey(); }
async Task Method3() { AsyncLocalDictionary.SetLogicalValue(key, "Method3"); await Task.Delay(10); Console.WriteLine($"Key Value [{AsyncLocalDictionary.GetLogicalValue<string>(key)}] should be Method3"); }