private static IDictionary GetTypeMappingDictionary()

in src/DeloitteDigital.Atlas/Mapping/MappingUtil.cs [44:62]


        private static IDictionary<string, TTypeMapper> GetTypeMappingDictionary<TTypeMapper>(ICache _cache, string cacheKey, object syncRoot)
             where TTypeMapper : class, ITypeMapper
        {
            var mappingDictionary = _cache.Get(cacheKey) as IDictionary<string, TTypeMapper>;
            if (mappingDictionary != null)
            {
                return mappingDictionary;
            }

            lock (syncRoot)
            {
                if (mappingDictionary == null)
                {
                    mappingDictionary = BuildTypeMappingDictionary<TTypeMapper>();
                    _cache.Set(cacheKey, mappingDictionary);
                }
            }
            return mappingDictionary;
        }