Пример #1
0
        private void AddCacheMappings(AssemblyBuilder builder)
        {
            Dictionary <CacheKey, string> mappings;

            using (Lock.ForReading())
            {
                mappings = new Dictionary <CacheKey, string>();
                foreach (var cacheEntry in typeCache)
                {
                    mappings.Add(cacheEntry.Key, cacheEntry.Value.FullName);
                }
            }

            CacheMappingsAttribute.ApplyTo(builder, mappings);
        }
Пример #2
0
//#if FEATURE_SERIALIZATION
        private void AddCacheMappings(AssemblyBuilder builder)
        {
            Dictionary <CacheKey, string> mappings;

            using (Lock.ForReading())
            {
                mappings = new Dictionary <CacheKey, string>();
                foreach (var cacheEntry in typeCache)
                {
                    // NOTE: using == returns invalid results.
                    // we need to use Equals here for it to work properly
                    if (builder.Equals(cacheEntry.Value.Assembly))
                    {
                        mappings.Add(cacheEntry.Key, cacheEntry.Value.FullName);
                    }
                }
            }

            CacheMappingsAttribute.ApplyTo(builder, mappings);
        }