Consider using SqlHierarchyId if possible (if it works also on non-MSSQL databases like PostgreSQL - otherwise not).
https://entityframeworkcore.com/en/knowledge-base/50594409/entity-framework-core-hierarchyid
https://docs.microsoft.com/en-us/dotnet/api/microsoft.sqlserver.types.sqlhierarchyid?view=sql-smo-140.17283.0
With this type you also get "nice helper" methods like GetRoot(), GetLevel() and others.
The representation oh HierarchyId if you make .ToString() is "similar" what is in current ABP Code: https://aspnetboilerplate.com/Pages/Documents/Zero/Organization-Units#ou-code
Consider also that one entity could be "located" inside multiple "not connected" levels inside hierarchy.
In many cases, the organization needs sorting. Can you provide a sorting field to enrich its functions
hi @crashsol @mperk is implementing this feature, you can discuss related issues in https://github.com/abpframework/abp/pull/2563.
Most helpful comment
Consider using SqlHierarchyId if possible (if it works also on non-MSSQL databases like PostgreSQL - otherwise not).
https://entityframeworkcore.com/en/knowledge-base/50594409/entity-framework-core-hierarchyid
https://docs.microsoft.com/en-us/dotnet/api/microsoft.sqlserver.types.sqlhierarchyid?view=sql-smo-140.17283.0
With this type you also get "nice helper" methods like GetRoot(), GetLevel() and others.
The representation oh HierarchyId if you make .ToString() is "similar" what is in current ABP Code: https://aspnetboilerplate.com/Pages/Documents/Zero/Organization-Units#ou-code
Consider also that one entity could be "located" inside multiple "not connected" levels inside hierarchy.