With Parents on pages
WSJF Columns
This commit is contained in:
2024-10-21 17:55:24 -07:00
parent 1241bbe622
commit 326bd1ea73
29 changed files with 532 additions and 367 deletions

View File

@ -1,4 +1,6 @@
using System.Collections.ObjectModel;
using System.Linq;
using System.Text.Json.Serialization;
namespace Adaptation.FileHandlers.json.WorkItems;
@ -7,7 +9,8 @@ public class Record
#nullable enable
public Record(WorkItem workItem, WorkItem? parent, ReadOnlyCollection<Record> children)
[JsonConstructor]
public Record(WorkItem workItem, WorkItem? parent, Record[] children)
{
WorkItem = workItem;
Parent = parent;
@ -16,6 +19,9 @@ public class Record
public WorkItem WorkItem { get; set; }
public WorkItem? Parent { get; set; }
public ReadOnlyCollection<Record> Children { get; set; }
public Record[] Children { get; set; }
public static Record Get(WorkItem workItem, WorkItem? parent, ReadOnlyCollection<Record> children) =>
new(workItem, parent, children.ToArray());
}