0

我有以下表格:

项目:

Id
SettlementId
...

沉降

Id
Name
AreaId

区域

Id
Name
...

我需要获取不属于任何项目的所有属于特定区域的定居点(我从选定的下拉列表中获取 areaId)。

到目前为止,这是我的查询:

var settlements = (from s in entities.Settlements
                  where s.AreaId == selectedAreaId
                  select s).toList();

我不完全确定如何过滤掉已经属于现有项目的定居点。

谢谢你的时间!

4

1 回答 1

1

你试过了吗?

where s.Projects.Count() == 0
于 2012-12-11T19:43:46.390 回答