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);
}