catalog impl
This commit is contained in:
@ -2,6 +2,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
using isnd.Interfaces;
|
||||
using isnd.Data.Catalog;
|
||||
|
||||
namespace isnd.Data.Packages.Catalog
|
||||
{
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
@ -12,6 +12,7 @@ namespace isnd.Data
|
||||
[Required]
|
||||
[ForeignKey("Package")]
|
||||
[StringLength(1024)]
|
||||
[JsonProperty("id")]
|
||||
public string PackageId { get; set; }
|
||||
|
||||
[Required]
|
||||
|
Reference in New Issue
Block a user