CoD
With Parents on pages WSJF Columns
This commit is contained in:
@ -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());
|
||||
|
||||
}
|
Reference in New Issue
Block a user