dotnet package resolution
This commit is contained in:
@ -34,18 +34,20 @@ namespace isnd.ViewModels
|
||||
private static PackageHit NewPackageHit(string apiBase, Package package)
|
||||
{
|
||||
string regId = $"{apiBase}{ApiConfig.Registration}/{package.Id}/index.json";
|
||||
|
||||
var latest = package.GetLatestVersion();
|
||||
if (latest==null) return null;
|
||||
|
||||
var pkgHit = new PackageHit(regId, package.Id)
|
||||
{
|
||||
version = package.GetLatestVersion(),
|
||||
description = package.Description,
|
||||
version = latest.NugetVersion.ToString(),
|
||||
description = latest.Description,
|
||||
};
|
||||
if (package.Versions!=null)
|
||||
{
|
||||
pkgHit.versions = package.Versions
|
||||
.Select(v => new SearchVersionInfo(apiBase, v)).ToArray();
|
||||
pkgHit.packageTypes = package.Versions
|
||||
.Select(v=>new PackageType(v.Type ?? "Legacy", new System.Version(v.Major,v.Minor,v.Patch, v.Revision)))?.ToArray();
|
||||
pkgHit.packageTypes = package.Versions.Where(v=> v.Type!=null)
|
||||
.Select(v=>new PackageType(v.Type, new System.Version(v.Major,v.Minor,v.Patch, v.Revision)))?.ToArray();
|
||||
}
|
||||
return pkgHit;
|
||||
}
|
||||
|
Reference in New Issue
Block a user