private static ChocolateyPackageVersion ConvertToPackageVersion(FeedPackage package) { var convertedPackage = new ChocolateyPackageVersion { Author = package.Authors, ChocolateyLink = new Uri(package.GalleryDetailsUrl), Id = package.Id, Title = package.Title, Description = package.Description, Version = package.Version, ReleaseNotes = package.ReleaseNotes, DownloadCount = package.DownloadCount, IconLink = string.IsNullOrEmpty(package.IconUrl) ? null : new Uri(package.IconUrl), ProjectLink = string.IsNullOrEmpty(package.ProjectUrl) ? null : new Uri(package.ProjectUrl) }; return convertedPackage; }
private ChocolateyPackage ConvertToPackage(FeedPackage package, IEnumerable<ChocolateyPackageVersion> installedPackages) { var convertedPackage = new ChocolateyPackage { Id = package.Id, IconLink = string.IsNullOrEmpty(package.IconUrl) ? null : new Uri(package.IconUrl), Title = package.Title, IsInstalled = installedPackages.Any(p => p.Id == package.Id) }; return convertedPackage; }