2023-02-16 12:57:06 +00:00
|
|
|
using SQLite;
|
|
|
|
|
2023-03-08 12:20:33 +00:00
|
|
|
namespace InnovEnergy.App.Backend.Model;
|
2023-02-16 12:57:06 +00:00
|
|
|
|
2023-02-24 12:59:56 +00:00
|
|
|
public abstract partial class TreeNode
|
2023-02-16 12:57:06 +00:00
|
|
|
{
|
|
|
|
[PrimaryKey, AutoIncrement]
|
|
|
|
public Int64 Id { get; set; }
|
|
|
|
public String Name { get; set; } = "";
|
|
|
|
public String Information { get; set; } = ""; // unstructured random info
|
2023-02-22 13:46:36 +00:00
|
|
|
|
2023-02-16 12:57:06 +00:00
|
|
|
[Indexed] // parent/child relation
|
|
|
|
public Int64 ParentId { get; set; }
|
|
|
|
|
|
|
|
[Ignore] // not in DB, can be used in typescript as type discriminator
|
|
|
|
public String Type => GetType().Name;
|
2023-02-24 12:59:56 +00:00
|
|
|
|
|
|
|
[Ignore]
|
|
|
|
public IReadOnlyList<TreeNode>? Children { get; set; }
|
|
|
|
|
2023-02-16 12:57:06 +00:00
|
|
|
}
|