isn/src/isnd/Data/Package.cs

48 lines
1.2 KiB
C#
Raw Normal View History

2021-08-23 03:21:08 +01:00
using System;
2021-06-21 23:38:05 +01:00
using System.Collections.Generic;
2021-05-16 14:07:14 +01:00
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
2021-08-23 03:21:08 +01:00
using isnd.Data.Catalog;
2021-06-21 23:38:05 +01:00
using Newtonsoft.Json;
2021-05-16 14:07:14 +01:00
2021-08-15 19:09:01 +01:00
namespace isnd.Data
2021-05-16 14:07:14 +01:00
{
2021-08-23 03:21:08 +01:00
public class Package : IObject
2021-05-16 14:07:14 +01:00
{
[Key][Required]
2021-09-05 15:44:47 +01:00
[StringLength(1024)]
2021-05-16 14:07:14 +01:00
public string Id { get; set; }
[Required]
[ForeignKey("Owner")]
public string OwnerId { get; set; }
2021-06-21 23:38:05 +01:00
[StringLength(1024)]
2021-05-16 14:07:14 +01:00
public string Description { get; set; }
2021-06-21 23:38:05 +01:00
2021-08-23 03:21:08 +01:00
public bool Public { get ; set;}
2021-06-21 23:38:05 +01:00
[JsonIgnore]
2021-05-16 14:07:14 +01:00
virtual public ApplicationUser Owner { get; set; }
2021-06-21 23:38:05 +01:00
[JsonIgnore]
public virtual List<PackageVersion> Versions { get; set; }
2021-08-28 18:41:22 +01:00
/// <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; }
2021-08-23 03:21:08 +01:00
public DateTime CommitTimeStamp { get; set; }
2021-05-16 14:07:14 +01:00
}
}