using System.Collections.Concurrent; namespace BITKit { public static class Generic { private static readonly string typeName = $"{typeof(T).FullName}."; private static readonly ConcurrentDictionary cacheMap = new(); public static string GetVariable(string str) { if (cacheMap.TryGetValue(str, out var cacheName)) { } else { cacheName = string.Concat(typeName, str); cacheMap.AddOrUpdate(str, x => cacheName, (x, y) => cacheName); return string.Concat(typeName, str); } return cacheName; } public static int Hash => typeof(T).GetHashCode(); } }