unit tests and pkg version commits
This commit is contained in:
parent
55e407d951
commit
f6fa7a0ec9
17 changed files with 553 additions and 89 deletions
|
|
@ -1,6 +1,8 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace isnd.Data.Catalog
|
||||
{
|
||||
|
|
@ -12,21 +14,25 @@ namespace isnd.Data.Catalog
|
|||
|
||||
public class Commit : IObject
|
||||
{
|
||||
[Key][Required,DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
[Key,
|
||||
DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
[JsonIgnore]
|
||||
public long Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[Required][JsonIgnore]
|
||||
public DateTime TimeStamp{ get; set; }
|
||||
|
||||
[Required]
|
||||
public PackageAction Action { get; set; }
|
||||
|
||||
[Required]
|
||||
public string PackageVersionId { get; set; }
|
||||
[ForeignKey("PackageVersionId")]
|
||||
|
||||
public virtual PackageVersion PackageVersion{ get; set; }
|
||||
[NotMapped]
|
||||
public string CommitId { get => Id.ToString(); }
|
||||
|
||||
[NotMapped]
|
||||
public DateTime CommitTimeStamp { get => TimeStamp; }
|
||||
|
||||
[ForeignKey("CommitNId")]
|
||||
|
||||
public virtual List<PackageVersion> Versions { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace isnd.Data.Catalog
|
||||
|
|
@ -38,6 +39,9 @@ namespace isnd.Data.Catalog
|
|||
[JsonProperty("nuget:version")]
|
||||
public string Version { get; set; }
|
||||
public string CommitId { get; set; }
|
||||
|
||||
[ForeignKey("CommitId")]
|
||||
public virtual Commit LastCommit { get; set; }
|
||||
public DateTime CommitTimeStamp { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -27,7 +27,21 @@ namespace isnd.Data
|
|||
[JsonIgnore]
|
||||
|
||||
public virtual List<PackageVersion> Versions { get; set; }
|
||||
public string CommitId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Latest package version put, or post,
|
||||
/// or { delete when no more active version }.
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[Required][JsonIgnore]
|
||||
public long CommitNId { get; set ; }
|
||||
|
||||
[NotMapped]
|
||||
public string CommitId { get => CommitNId.ToString(); }
|
||||
|
||||
[ForeignKey("CommitNId")]
|
||||
|
||||
public virtual Commit LatestVersion{ get; set; }
|
||||
public DateTime CommitTimeStamp { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using isnd.Data.Catalog;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace isnd.Data
|
||||
|
|
@ -30,6 +31,16 @@ namespace isnd.Data
|
|||
[JsonIgnore]
|
||||
public virtual Package Package { get; set; }
|
||||
|
||||
[Required][JsonIgnore]
|
||||
public long CommitNId { get; set ; }
|
||||
|
||||
[NotMapped]
|
||||
|
||||
public string CommitId { get => CommitNId.ToString(); }
|
||||
|
||||
[ForeignKey("CommitNId")]
|
||||
|
||||
public virtual Commit LatestCommit{ get; set; }
|
||||
public string NugetLink => $"/package/{PackageId}/{FullString}/{PackageId}-{FullString}.nupkg";
|
||||
public string NuspecLink => $"/package/{PackageId}/{FullString}/{PackageId}-{FullString}.nuspec";
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue