27 lines
668 B
C#
27 lines
668 B
C#
using System.Collections.ObjectModel;
|
|
using System.Linq;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace Adaptation.FileHandlers.json.WorkItems;
|
|
|
|
public class Record
|
|
{
|
|
|
|
#nullable enable
|
|
|
|
[JsonConstructor]
|
|
public Record(WorkItem workItem, WorkItem? parent, Record[] children)
|
|
{
|
|
WorkItem = workItem;
|
|
Parent = parent;
|
|
Children = children;
|
|
}
|
|
|
|
public WorkItem WorkItem { get; set; }
|
|
public WorkItem? Parent { get; set; }
|
|
public Record[] Children { get; set; }
|
|
|
|
public static Record Get(WorkItem workItem, WorkItem? parent, ReadOnlyCollection<Record> children) =>
|
|
new(workItem, parent, children.ToArray());
|
|
|
|
} |