using System.Threading; namespace VolPro.Core.Generic { public static class GenericTableAsyncLocal { private static readonly AsyncLocal _currentTableName = new AsyncLocal(); /// /// 当前请求对应的表名 /// public static string CurrentTableName { get => _currentTableName.Value; set { if (_currentTableName.Value==null) { _currentTableName.Value = value; } } } public static void Clear() { _currentTableName.Value = null; } } }