internal IEnumerable <PackageItem> GetPackageById(string name, string requiredVersion = null, string minimumVersion = null, string maximumVersion = null, bool allowUnlisted = false) { if (String.IsNullOrEmpty(name)) { return(Enumerable.Empty <PackageItem>()); } return(SelectedSources.AsParallel().WithMergeOptions(ParallelMergeOptions.NotBuffered).SelectMany(source => GetPackageById(source, name, requiredVersion, minimumVersion, maximumVersion, allowUnlisted))); }
internal IEnumerable <PackageItem> GetPackageByIdAndVersionSpec(string name, IVersionSpec versionSpec, bool allowUnlisted = false) { if (String.IsNullOrEmpty(name)) { return(Enumerable.Empty <PackageItem>()); } return(SelectedSources.AsParallel().WithMergeOptions(ParallelMergeOptions.NotBuffered).SelectMany(source => { var pkgs = source.Repository.FindPackages(name, versionSpec, AllowPrereleaseVersions, allowUnlisted); /* * // necessary? * pkgs = from p in pkgs where p.IsLatestVersion select p; */ var pkgs2 = pkgs.ToArray(); return pkgs2.Select(pkg => new PackageItem { Package = pkg, PackageSource = source, FastPath = MakeFastPath(source, pkg.Id, pkg.Version.ToString()) }); }).OrderByDescending(each => each.Package.Version)); }
internal IEnumerable <PackageItem> SearchForPackages(string name, string requiredVersion, string minimumVersion, string maximumVersion) { return(SelectedSources.AsParallel().WithMergeOptions(ParallelMergeOptions.NotBuffered).SelectMany(source => SearchSourceForPackages(source, name, requiredVersion, minimumVersion, maximumVersion))); }