Hierarchical data
Trees in a database and on a screen: from a flat list with parent ids to a tree in one line, hierarchies at any depth in EF Core, and the same tree in a Vue SPA, expandable and draggable.
-
From a Flat List to a Tree in One Line of C#
A quick look at turning a flat collection with parent references into a navigable hierarchy, without writing recursion yourself.
-
How to Query Hierarchies at Any Depth with EF Core
Answer 'everything under X' for category trees, org charts and folders, at any depth. Three approaches, from one that works on any database to one that scales to millions of rows, and how to pick.
-
The API Sends a List, the Screen Needs a Tree
Show the flat list an API returns as a tree users can expand, select and drag to a new parent. No recursive component, and illegal drops are refused in the browser before they reach the server.