/// <summary> /// 从Scoped字典中获取指定类型的值 /// </summary> public static T GetValue <T>(this ScopedDictionary dict, string key) where T : class { if (dict.TryGetValue(key, out object obj)) { return(obj as T); } return(default(T)); }