Re: [ADVANCED-DOTNET] LINQ to SQL and a recursive selection

2008-05-09 Thread Marc Brooks
Indeed, I left that proviso out... In general this seems to be the case for inherited hierarchies, and it's not any worse that random ordering _most_ of the time. Marc On 5/9/08, Frans Bouma <[EMAIL PROTECTED]> wrote: > > > First, simply fetch the employees in full: > > > var q = from e in ctx.E

Re: [ADVANCED-DOTNET] LINQ to SQL and a recursive selection

2008-05-09 Thread Frans Bouma
> > First, simply fetch the employees in full: > > var q = from e in ctx.Employees select e; > > Excellent description, Frans... one thing I like to point out is that > if you make your initial (flat) query from the database ordered by the > parent id and entry id, you get "in-order insertion" be

Re: [ADVANCED-DOTNET] LINQ to SQL and a recursive selection

2008-05-09 Thread Marc Brooks
> First, simply fetch the employees in full: > var q = from e in ctx.Employees select e; Excellent description, Frans... one thing I like to point out is that if you make your initial (flat) query from the database ordered by the parent id and entry id, you get "in-order insertion" behavior when

Re: [ADVANCED-DOTNET] LINQ to SQL and a recursive selection

2008-05-09 Thread Frans Bouma
> http://www.llblgen.com/tinyforum/GotoMessage.aspx?MessageID=17746&ThreadID=320 > 8 the url wrapped, be sure to append the '8' to the url, otherwise you end up in an old thread;) FB === This list is hosted by DevelopMentorĀ® http://www.dev

Re: [ADVANCED-DOTNET] LINQ to SQL and a recursive selection

2008-05-09 Thread Frans Bouma
> Not sure if recursive is the right word, but here's the situation: Hierarchical fetches, tree-fetches, nested set model queries etc. it has a truckload of names ;) > Using AdventureWorks, LINQPad, and the Employee table. > > An Employee has a ManagerID column. If the value is NULL then

[ADVANCED-DOTNET] LINQ to SQL and a recursive selection

2008-05-08 Thread Ron Young
Not sure if recursive is the right word, but here's the situation: Using AdventureWorks, LINQPad, and the Employee table. An Employee has a ManagerID column. If the value is NULL then that Employee has no manager. What I want to do is select the top-level employee, his/her subordinates, and fo