Skip to content

Commit 78b3166

Browse files
committed
Cache AnyKey registrations per scope.
1 parent 380a857 commit 78b3166

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/Autofac/Features/KeyedServices/AnyKeyRegistrationSource.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,12 @@ internal sealed class AnyKeyRegistrationSource : IRegistrationSource
2222
/// </summary>
2323
public AnyKeyRegistrationSource()
2424
{
25-
_adapterCache = ReflectionCacheSet.Shared.GetOrCreateCache<ReflectionCacheKeyedServiceDictionary<IComponentRegistration[]>>(nameof(AnyKeyRegistrationSource));
26-
_adapterCache.Usage = ReflectionCacheUsage.Resolution;
25+
_adapterCache = new ReflectionCacheKeyedServiceDictionary<IComponentRegistration[]>
26+
{
27+
Usage = ReflectionCacheUsage.Resolution,
28+
};
29+
30+
ReflectionCacheSet.Shared.RegisterExternalCache(_adapterCache);
2731
}
2832

2933
/// <inheritdoc/>

0 commit comments

Comments
 (0)