public PackageSearchMetadataCacheItemEntry(IPackageSearchMetadata packageSearchMetadata, IPackageMetadataProvider packageMetadataProvider)
 {
     _packageSearchMetadata         = packageSearchMetadata;
     _packageMetadataProvider       = packageMetadataProvider;
     _detailedPackageSearchMetadata = AsyncLazy.New(() =>
     {
         return(_packageMetadataProvider.GetPackageMetadataForIdentityAsync(_packageSearchMetadata.Identity, CancellationToken.None));
     });
 }
        public async ValueTask <PackageSearchMetadataCacheItemEntry> GetPackageSearchMetadataCacheVersionedItemAsync(PackageIdentity packageIdentity, CancellationToken cancellationToken)
        {
            Assumes.NotNull(packageIdentity);

            if (!_cachedItemEntries.TryGetValue(packageIdentity.Version, out PackageSearchMetadataCacheItemEntry cacheItemEntry))
            {
                IPackageSearchMetadata packageSearchMetadata = await _packageMetadataProvider.GetPackageMetadataForIdentityAsync(packageIdentity, cancellationToken);

                cacheItemEntry = new PackageSearchMetadataCacheItemEntry(packageSearchMetadata, _packageMetadataProvider);
                _cachedItemEntries[packageIdentity.Version] = cacheItemEntry;
            }

            return(cacheItemEntry);
        }