by Nuget version

This commit is contained in:
Paul Schneider 2022-09-27 00:39:17 +01:00
commit c147eaf54a
8 changed files with 46 additions and 38 deletions

View file

@ -1,20 +1,27 @@
using System.Collections.Generic;
using Newtonsoft.Json;
namespace isnd.Data.Catalog
{
public class PackageRegistrationIndexQuery : RegistrationPageIndex
public class RegistrationPageIndexQuery : RegistrationPageIndex
{
public PackageRegistrationIndexQuery(string id) : base(id)
public RegistrationPageIndexQuery() : base("")
{
}
public RegistrationPageIndexQuery(string bid, IEnumerable<RegistrationLeaf> leaves) : base(bid, leaves)
{
}
[JsonProperty("prerelease")]
public bool Prerelease { get; set; }
[JsonProperty("query")]
public string Query { get; set; }
[JsonProperty("totalHits")]
public int TotalHits { get; internal set; }
[JsonProperty("prerelease")]
public bool Prerelease { get; set; }
public int Skip { get; set; }
public int Take { get; set; } = 25;
public int TotalHits { get; set; }
}
}

View file

@ -12,6 +12,7 @@ namespace isnd.Data.Catalog
public RegistrationPage (string id)
{
Id = id;
Items = new List<RegistrationLeaf>();
}
/// <summary>

View file

@ -54,7 +54,7 @@ namespace isnd.Data.Packages
public RegistrationLeaf ToLeave(string bid)
{
if (Versions.Count == 0) throw new Exception("NO VERSION");
var v = Versions.OrderBy(w => w.SystemVersion).First();
var v = Versions.OrderBy(w => w.NugetVersion).First();
RegistrationLeaf leave = new RegistrationLeaf
{
Id = bid + Id + "/" + v.FullString + ".json",

View file

@ -1,10 +1,11 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using isn.abst;
using isnd.Data.Packages;
using isnd.Data.Packages.Catalog;
using Newtonsoft.Json;
using NuGet.Versioning;
namespace isnd.Data
{
@ -53,7 +54,7 @@ namespace isnd.Data
+ Constants.SpecFileEstension;
public string SementicVersionString { get => $"{Major}.{Minor}.{Patch}"; }
public Version SystemVersion { get => new Version(Major, Minor, Patch, Revision); }
public NuGetVersion NugetVersion { get => new NuGetVersion(FullString); }
}
}