Esempio n. 1
0
        public IPackageSearchMetadata Build()
        {
            var clonedMetadata = new ClonedPackageSearchMetadata
            {
                Authors                  = _metadata.Authors,
                DependencySets           = _metadata.DependencySets ?? Enumerable.Empty <PackageDependencyGroup>(),
                Description              = _metadata.Description,
                DownloadCount            = _metadata.DownloadCount,
                IconUrl                  = _metadata.IconUrl,
                Identity                 = _metadata.Identity,
                LicenseUrl               = _metadata.LicenseUrl,
                Owners                   = _metadata.Owners,
                ProjectUrl               = _metadata.ProjectUrl,
                Published                = _metadata.Published,
                ReportAbuseUrl           = _metadata.ReportAbuseUrl,
                PackageDetailsUrl        = _metadata.PackageDetailsUrl,
                RequireLicenseAcceptance = _metadata.RequireLicenseAcceptance,
                Summary                  = _metadata.Summary,
                Tags  = _metadata.Tags,
                Title = _metadata.Title,
                LazyVersionsFactory = _lazyVersionsFactory,
                IsListed            = _metadata.IsListed,
                PrefixReserved      = _metadata.PrefixReserved,
                LicenseMetadata     = _metadata.LicenseMetadata,
            };

            return(clonedMetadata);
        }
        private UpdatePackageSearchMetadataBuilder(ClonedPackageSearchMetadata metadata, IPackageSearchMetadata updatedVersionMetadata)
        {
            Argument.IsNotNull(() => metadata);
            Argument.IsNotNull(() => updatedVersionMetadata);

            _metadata = metadata;
            _updatedVersionMetadata = updatedVersionMetadata;
        }
Esempio n. 3
0
        public static PackageSearchMetadataBuilder FromIdentity(PackageIdentity identity)
        {
            var metadata = new ClonedPackageSearchMetadata
            {
                Identity = identity,
                Title    = identity.Id,
                Summary  = string.Empty,
                Authors  = string.Empty
            };

            return(FromMetadata(metadata));
        }
        public IPackageSearchMetadata Build()
        {
            var clonedMetadata = new ClonedPackageSearchMetadata
            {
                Authors                  = _metadata.Authors,
                DependencySets           = _metadata.DependencySets ?? Enumerable.Empty <PackageDependencyGroup>(),
                Description              = _metadata.Description,
                DownloadCount            = _metadata.DownloadCount,
                IconUrl                  = _metadata.IconUrl,
                Identity                 = _metadata.Identity,
                LicenseUrl               = _metadata.LicenseUrl,
                Owners                   = _metadata.Owners,
                ProjectUrl               = _metadata.ProjectUrl,
                Published                = _metadata.Published,
                ReadmeUrl                = _metadata.ReadmeUrl,
                ReportAbuseUrl           = _metadata.ReportAbuseUrl,
                PackageDetailsUrl        = _metadata.PackageDetailsUrl,
                RequireLicenseAcceptance = _metadata.RequireLicenseAcceptance,
                Summary                  = _metadata.Summary,
                Tags  = _metadata.Tags,
                Title = _metadata.Title,
                LazyVersionsFactory    = _lazyVersionsFactory,
                IsListed               = _metadata.IsListed,
                PrefixReserved         = _metadata.PrefixReserved,
                LicenseMetadata        = _metadata.LicenseMetadata,
                LazyDeprecationFactory = _lazyDeprecationFactory ?? AsyncLazy.New(_metadata.GetDeprecationMetadataAsync),
                Vulnerabilities        = _metadata.Vulnerabilities,
#pragma warning disable CS0618 // Type or member is obsolete
                PackageReader =
                    (_metadata as LocalPackageSearchMetadata)?.PackageReader ??
                    (_metadata as ClonedPackageSearchMetadata)?.PackageReader,
#pragma warning restore CS0618 // Type or member is obsolete
                PackagePath =
                    (_metadata as LocalPackageSearchMetadata)?.PackagePath ??
                    (_metadata as ClonedPackageSearchMetadata)?.PackagePath,
            };

            return(clonedMetadata);
        }
 public static UpdatePackageSearchMetadataBuilder FromMetadatas(ClonedPackageSearchMetadata metadata, IPackageSearchMetadata updatedVersionMetadata)
 => new UpdatePackageSearchMetadataBuilder(metadata, updatedVersionMetadata);