I have a tree structure of an organization chart stored in a database. This is something like
ID (int); Name (String); ParentID (int)
In C #, it is represented by a class like
class Employee { int ID, string Name, IList < Employee> Subs }
I am wondering how best to get these values ββfrom a database in order to populate C # objects using LINQ (I use Entity Framework)
There must be something better than making a call to get the top level, and then repeat the calls to get subtitles, etc.
What is the best way to do this?
c # linq-to-entities entity-framework
Emad
source share