using Salmon.Core.Cliff; namespace Salmon.Core; public class Element { //Should not persist, only for convenient use (ex: Json serialization) public string? LastType { get; set; } [IdentifierField] public string UniqueId { get; } [PersistentField("parent")] public string? ParentId { get; set; } [PersistentField] public string? ShortName { get; set; } [PersistentField] public string? LongName { get; set; } [PersistentField] public string? Description { get; set; } #pragma warning disable CS8618 // for autoconstruct protected Element() #pragma warning restore CS8618 { } public Element(string id) { UniqueId = id; LastType = GetType().Name; } public Dictionary SupplementaryProperties = new Dictionary(); public virtual IEnumerable> ImportantProperties() { /*if (ParentId != null) yield return KeyValuePair.Create(nameof(ParentId), ParentId);*/ yield break; } }