c# - implementing a recursive linq -


so let's have table relation itself, example

table page ------------- idpage  description     idpage_fk <-- foreign key  

now table it's mapped entity framework this

class page ----------- int idpage string description int idpage_fk page page1 icolletion<page> page2 

what want archive if it's possible, it's created linq expression navigate on table make output in string variable:

assuming values in table

idpage    description    idpage_fk  1         example        null  2         example2         1  3         example3         2 

this output on string variable

string inheritance = (from p in page select....) 

the output this

example > example2 > example3 

it's possible? or have create method loop each element create variable?

sorry, can't recursive linq out database - you'll either have write iterative function or create stored procedure you.

similar question:

how entity framework work recursive hierarchies? include() seems not work it


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -