public DetailedPackageMetadata(IPackageSearchMetadata serverData, long?downloadCount) { Version = serverData.Identity.Version; Summary = serverData.Summary; Description = serverData.Description; Authors = serverData.Authors; Owners = serverData.Owners; IconUrl = serverData.IconUrl; LicenseUrl = serverData.LicenseUrl; ProjectUrl = serverData.ProjectUrl; ReportAbuseUrl = serverData.ReportAbuseUrl; Tags = serverData.Tags; DownloadCount = downloadCount; Published = serverData.Published; DependencySets = serverData.DependencySets? .Select(e => new PackageDependencySetMetadata(e)) ?? new PackageDependencySetMetadata[] { }; HasDependencies = DependencySets.Any( dependencySet => dependencySet.Dependencies != null && dependencySet.Dependencies.Count > 0); PrefixReserved = serverData.PrefixReserved; }
public ServerPackage(string id, SemanticVersion version, string title, IEnumerable <string> authors, IEnumerable <string> owners, Uri iconUrl, Uri licenseUrl, Uri projectUrl, bool requireLicenseAcceptance, bool developmentDependency, string description, string summary, string releaseNotes, string language, string tags, string copyright, string dependencies, Version minClientVersion, Uri reportAbuseUrl, int downloadCount, string supportedFrameworks, bool isAbsoluteLatestVersion, bool isLatestVersion, bool listed, DateTimeOffset?published, long packageSize, string packageHash, string packageHashAlgorithm, DateTimeOffset lastUpdated, DateTimeOffset created, string path, string fullPath) { Id = id; Version = version; Title = title; Authors = authors; Owners = owners; IconUrl = iconUrl; LicenseUrl = licenseUrl; ProjectUrl = projectUrl; RequireLicenseAcceptance = requireLicenseAcceptance; DevelopmentDependency = developmentDependency; Description = description; Summary = summary; ReleaseNotes = releaseNotes; Language = language; Tags = tags; Copyright = copyright; Dependencies = dependencies; MinClientVersion = minClientVersion; ReportAbuseUrl = reportAbuseUrl; DownloadCount = downloadCount; SupportedFrameworks = supportedFrameworks; IsAbsoluteLatestVersion = isAbsoluteLatestVersion; IsLatestVersion = isLatestVersion; Listed = listed; Published = published; PackageSize = packageSize; PackageHash = packageHash; PackageHashAlgorithm = packageHashAlgorithm; LastUpdated = lastUpdated; Created = created; Path = path; FullPath = fullPath; // Preload collections DependencySets.Any(); SupportedFrameworks.Any(); }