示例#1
0
 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();
 }
示例#2
0
        async Task Method3()
        {
            AsyncLocalDictionary.SetLogicalValue(key, "Method3");
            await Task.Delay(10);

            Console.WriteLine($"Key Value [{AsyncLocalDictionary.GetLogicalValue<string>(key)}] should be Method3");
        }