SQL-запрос:
Код: Выделить всё
select child.id from GlobalDocumentClassification child
inner join GlobalDocumentClassification parent
on child.HierarchyId.IsDescendantOf(parent.HierarchyId) = CAST(1 AS bit) and
parent.Id in ('3895598f-67f2-42a1-8960-076acc00fd28')
Код: Выделить всё
var entityIds =
from child in Context.GlobalDocumentClassification
join parent in Context.GlobalDocumentClassification
on child.HierarchyId.IsDescendantOf(child.HierarchyId) equals true
where EF.Constant(documentClassificationIds).Contains(parent.Id)
select child.Id;
В этой статье SO более подробно описывается сторона проблемы SQL, но мне опять же нужно выразить свой запрос с помощью LINQ. Linq to SQL: как присоединиться без поля, т. е. декартово соединение
Ваша помощь очень ценится
[img]https://i.sstatic .net/itbum05j.png[/img]
Подробнее здесь: https://stackoverflow.com/questions/792 ... inq-to-sql
Мобильная версия