|
|
|
@ -21,14 +21,20 @@ namespace isnd.Data.Catalog
|
|
|
|
|
|
|
|
|
|
public RegistrationPageIndex(string bid, string id, string dlBase, IEnumerable<Package> pkgs)
|
|
|
|
|
{
|
|
|
|
|
// leaves;
|
|
|
|
|
this.Items = new List<RegistrationPage>
|
|
|
|
|
(pkgs.GroupBy(l => l.Id)
|
|
|
|
|
.Select(lg => new RegistrationPage
|
|
|
|
|
(bid, lg.Key, dlBase, lg.ToArray()
|
|
|
|
|
.Select(p => p.Versions).Aggregate
|
|
|
|
|
((l, m) => { l.AddRange(m); return l.ToList(); })
|
|
|
|
|
)));
|
|
|
|
|
Items = new List<RegistrationPage>();
|
|
|
|
|
var pkgsGroups = pkgs.GroupBy(l => l.Id);
|
|
|
|
|
// Pour tous les groupes par Id
|
|
|
|
|
foreach (var gsp in pkgsGroups)
|
|
|
|
|
{
|
|
|
|
|
var pkgsbi = gsp.ToArray();
|
|
|
|
|
List<PackageVersion> versions = new List<PackageVersion>();
|
|
|
|
|
|
|
|
|
|
foreach(var l in pkgsbi.Select(p => p.Versions))
|
|
|
|
|
{
|
|
|
|
|
versions.AddRange(l);
|
|
|
|
|
}
|
|
|
|
|
Items.Add(new RegistrationPage(bid, gsp.Key, dlBase, versions));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[JsonProperty("count")]
|
|
|
|
|