示例#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
        private void AddCacheMappings(AssemblyBuilder builder)
        {
            var mappings = new Dictionary <CacheKey, string>();

            typeCache.ForEach((key, value) =>
            {
                // NOTE: using == returns invalid results.
                // we need to use Equals here for it to work properly
                if (builder.Equals(value.Assembly))
                {
                    mappings.Add(key, value.FullName);
                }
            });

            CacheMappingsAttribute.ApplyTo(builder, mappings);
        }
示例#3
0
        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);
        }