我有一个SQL查询
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
我希望将其转换为LINQ to SQL,但我的LINQ技能还不够。请问有人能帮我转换一下吗?其中with和union语句让这个问题变得更加复杂了一些。感谢任何帮助。