0

我正在尝试查询该列为 NULL 的记录:

 Dim UnassignedSubSvc =
 (From c In CurrentContext.SubService
 Where c.Product.ProductSubServiceId  **is null**
 Select c).ToList()
4

1 回答 1

1
 Dim UnassignedSubSvc =
 (From c In CurrentContext.SubService
 Where Not c.ProductSubServiceId.HasValue
 Select c).ToList()

可空类型用于HasValue指示它们包含非空值,因此只需否定就足够了。

于 2012-05-04T18:22:51.910 回答