A small caching utility, can you tell if it is thread safe?public static class CacheService{    private readonly static object locker = new object();    private static Dictionary<string, Dictionary<string, object>> data = new Dictionary<string, Dictionary<string, object>>();    public static void Insert(string partition, string key, object value)    {        lock (locker)        {            if (!data.ContainsKey(partition))            {                var newVal = new Dictionary<string, object>();                newVal.Add(key, value);                data.Add(partition, newVal);            }            else            {                if (!data[partition].ContainsKey(key))                {                    data[partition].Add(key, value);                }                else                {                    data[partition][key] = value;                }            }        }    }    public static bool KeyExists(string partition, string key)    {        return data[partition] != null && data[partition][key] != null;    }    public static V Get<V>(string partition, string key)    {        return (V)data[partition][key];    }}
Thread safe static collection, is this code safe
c#;thread safety;cache