WIP reg page

This commit is contained in:
Paul Schneider 2022-09-23 20:34:51 +01:00
commit fececb327e
36 changed files with 264 additions and 211 deletions

View file

@ -46,17 +46,22 @@ namespace isnd.Data.Packages
public virtual Commit LatestVersion{ get; set; }
public DateTime CommitTimeStamp { get; set; }
internal RegistrationLeaf ToLeave()
/// <summary>
/// Returns the leaf
/// </summary>
/// <param name="bid">base url tu use for building the id property</param>
/// <returns></returns>
internal RegistrationLeaf ToLeave(string bid)
{
if (!(Versions != null &&
Versions.Count > 0)) throw new Exception("NO VERSION");
if (Versions.Count == 0) throw new Exception("NO VERSION");
var v = Versions.First();
RegistrationLeaf leave = new RegistrationLeaf
{
Id = bid + Id + ".json",
PackageContent = v.NugetLink,
Entry = new CatalogEntry
{
Id = bid + Id + ".json",
idp = Id,
version = v.FullString,
authors = $"{Owner.FullName} <${Owner.Email}>"