xunit web server collection
This commit is contained in:
parent
282b0277ae
commit
3695c17429
38 changed files with 1033 additions and 140 deletions
|
|
@ -10,14 +10,40 @@ using isnd.Data.Packages;
|
|||
|
||||
namespace isnd.Data
|
||||
{
|
||||
/// <summary>
|
||||
/// Application Db Context
|
||||
/// </summary>
|
||||
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
|
||||
{
|
||||
/// <summary>
|
||||
/// db context ctor
|
||||
/// </summary>
|
||||
/// <param name="options"></param>
|
||||
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
|
||||
: base(options) { }
|
||||
|
||||
/// <summary>
|
||||
/// User API keys
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public DbSet<ApiKey> ApiKeys { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Packages
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public DbSet<Package> Packages { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Package Versions
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public DbSet<PackageVersion> PackageVersions { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Commits
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public DbSet<Commit> Commits { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,13 +14,13 @@ namespace isnd.Data.Catalog
|
|||
catalogEntry object yes
|
||||
packageContent string yes
|
||||
*/
|
||||
[JsonProperty("@id")]
|
||||
[Key][Required]
|
||||
[StringLength(1024)]
|
||||
/// <summary>
|
||||
/// The URL to the registration leaf
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[JsonProperty("@id")]
|
||||
[Key][Required]
|
||||
[StringLength(1024)]
|
||||
public string Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ namespace isnd.Data.Catalog
|
|||
[JsonRequired]
|
||||
public string Id { get; protected set;}
|
||||
|
||||
private string pkgid;
|
||||
private List<PackageVersion> items;
|
||||
private readonly string pkgid;
|
||||
private readonly List<PackageVersion> items;
|
||||
|
||||
protected string Bid { get ; private set; }
|
||||
protected string DlBase { get; }
|
||||
|
|
|
|||
|
|
@ -46,28 +46,5 @@ namespace isnd.Data.Packages
|
|||
|
||||
public virtual Commit LatestVersion{ get; set; }
|
||||
public DateTime CommitTimeStamp { get; set; }
|
||||
/// <summary>
|
||||
/// Returns the leaf
|
||||
/// </summary>
|
||||
/// <param name="bid">base url tu use for building the id property</param>
|
||||
/// <returns></returns>
|
||||
public RegistrationLeaf ToLeave(string bid, string dlbase)
|
||||
{
|
||||
if (Versions.Count == 0) throw new Exception("NO VERSION");
|
||||
var v = Versions.OrderBy(w => w.NugetVersion).First();
|
||||
RegistrationLeaf leave = new RegistrationLeaf
|
||||
{
|
||||
Id = bid + Id + "/" + v.FullString + ".json",
|
||||
PackageContent = dlbase + "/" + v.NugetLink,
|
||||
Entry = new CatalogEntry
|
||||
{
|
||||
Id = bid + Id + ".json",
|
||||
idp = Id,
|
||||
version = v.FullString,
|
||||
authors = $"{Owner.FullName} <${Owner.Email}>"
|
||||
}
|
||||
};
|
||||
return leave;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue