using System.ComponentModel.DataAnnotations; using isnd.Entities; using Newtonsoft.Json; using isn.abst; namespace isnd.Data.Catalog { /// /// Hosts a catalog entry, /// the atomic content reference /// public class Package { public Package(string apiBase, string pkgId, string fullVersionString, PackageDetails entry) { this.registration = apiBase + ApiConfig.Registration + "/" + pkgId + "/" + fullVersionString + ".json"; Id = registration; this.PackageContent = apiBase + ApiConfig.Nuget + "/" + pkgId + "/" + fullVersionString + "/" + pkgId + "-" + fullVersionString + "." + Constants.PaquetFileEstension; Entry = entry; } /* @id string yes catalogEntry object yes packageContent string yes */ /// /// The URL to the registration leaf /// /// [JsonProperty("@id")] [Key][Required] [StringLength(1024)] public string Id { get; set; } /// /// The catalog entry containing the package metadata /// /// [JsonProperty("catalogEntry")] public PackageDetails Entry { get; set; } /// /// The URL to the package content (.nupkg) /// /// [JsonProperty("packageContent")] public string PackageContent { get; set; } public string registration { get; set; } } }