namespace AmrControl.Common { public class ThreadLocalManager { private static readonly AsyncLocal _current = new(); /// /// 设置上下文 /// /// public static void Set(ThreadLocalContext context) { _current.Value = context; } /// /// 获取上下文内容 /// /// public static ThreadLocalContext Get() { return _current.Value; } /// /// 移除上下文 /// public static void Remove() { _current.Value = null; } } }