Innovenergy_trunk/csharp/App/Backend/Model/TreeNode.cs

21 lines
593 B
C#
Raw Normal View History

2023-02-16 12:57:06 +00:00
using SQLite;
2023-02-24 11:58:47 +00:00
namespace Innovenergy.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
}