catalog impl

This commit is contained in:
Paul Schneider 2022-08-20 12:54:24 +01:00
commit 14206ac477
27 changed files with 320 additions and 44 deletions

View file

@ -2,6 +2,8 @@ using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using isnd.Data.Catalog;
using isnd.Interfaces;
using Newtonsoft.Json;
@ -44,5 +46,23 @@ namespace isnd.Data.Packages
public virtual Commit LatestVersion{ get; set; }
public DateTime CommitTimeStamp { get; set; }
internal RegistrationLeaf ToLeave()
{
if (!(Versions != null &&
Versions.Count > 0)) throw new Exception("NO VERSION");
var v = Versions.First();
RegistrationLeaf leave = new RegistrationLeaf
{
PackageContent = v.NugetLink,
Entry = new CatalogEntry
{
idp = Id,
version = v.FullString,
authors = $"{Owner.FullName} <${Owner.Email}>"
}
};
return leave;
}
}
}