Convert SQL to LINQ to SQL
- by Adam
Hi
I have the SQL query
with c as (
select categoryId,parentId, name,0 as [level]
from task_Category b
where b.parentId is null
union all
select b.categoryId,b.parentId,b.name,[level] + 1
from task_Category b join c on b.parentId =
c.categoryId)
select name,[level],categoryId,parentId
as item
from c
and I want to convert it to LINQ to SQL, yet my LINQ skills are not there yet. Could someone please help me convert this. It's the with and union statements that are making this a bit more complex for me.
Any help appreciated.