How I can generate HierarchyId automatically/programmatically in .NET Core, I set a Category as another's child and expect the HierarchyId field to be updated automatically but nothing happens.
Do I need a method to calculate and update it manually?
public class Category : BaseModelSimple<int>
{
public HierarchyId Node { get; set; }
public int? ParentId { get; set; }
[ForeignKey("ParentId")]
public virtual Category Parent { get; set; }
public virtual ICollection<Category> Childs { get; set; }
}