c# - Self Referencing Many-To-Many Linq Query -
c# - Self Referencing Many-To-Many Linq Query - i have datatable this: mtom { parentid, childid } item { id, data, label } how write linq query returns every childid under given parentid , associated info , label each of these decendent ids. if using sql i'd utilize union all , inner join , don't know linq plenty this. performance absolutely not issue there @ 3 levels of nesting , 1 or 2 items in each level. ddl i'm trying populate used , not mission critical. assuming kid id refering id field in items table u can write next query fetch required records from mt in mtom mt.parentid == givenparentid bring together in item on mt.childid equals it.id select new { parentid = mt.parentid, childid = it.id, childdata = it.data, childlabel = it.label} data beingness returned in anonymous type. u can create new type , populate resultant records c# linq linq-to-sql