作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个父子集合对象,想知道如何使用 Linq 从子集合中获取单个项目
父集合
Public Class FaultCodeModel
Public Property ID As Short
Public Property Description As String
Public Property FaultCodeDetails As List(Of FaultCodeDetailModel)
End Class
Public Class FaultCodeDetailModel
Public Property ID As Short
Public Property Description As String
Public Property NotifyPurchasing As Boolean
Public Property NotifyPurchasingAfterHits As Short
Public Property NotifyExpediting As Boolean
Public Property NotifyExpeditingAfterHits As Short
Public Property NotifyBuyer As Boolean
Public Property NotifyBuyerAfterHits As Short
Public Property NotifySupplier As Boolean
Public Property NotifySupplierAfterHits As Short
Public Property NotiifyProPack As Boolean
Public Property NotiifyProPackAfterHits As Short
Public Property NotifyGoodsInTeamLeader As Boolean
Public Property NotifyGoodsInTeamLeaderAfterHits As Short
End Class
Dim var = From fcd In FaultCodes Where fcd.FaultCodeDetails.Any(Function(w) w.ID.Equals(faultCodeDetailID))
Select fcd.FaultCodeDetails
最佳答案
我想你想要这个:
FaultCodes.SelectMany(Function(w) w.FaultCodeDetails)
.Where(Function(w) w.ID.Equals(faultCodeDetailID))
ID
的所有子项。等于
faultCodeDetailID
.
FaultCodes.SelectMany(x => x.FaultCodeDetails)
.Where(x => x.ID == faultCodeDetailID)
关于.net - Linq - 从子集合中选择单个项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8834521/
我以前使用过像 Netbeans 和 eclipse 这样的 IDE。 我在 friend 的电脑上下载了“Visual Studio Express 2013 for windows desktop
我正在尝试弄清楚如何在 GBA 大小的 EZ Flash 3 合 1 卡中对 PSRAM 进行编程。基本上重复 GBA Exploader 和其他程序所做的事情。 如果我选择一个 block 并对其进
Filter1=re.findall(r'',PageSource) Filter2=re.findall(r'',PageSource) Filter3=re.findall(r'(.*?).*?'
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 我们不允许在 Stack Overflow 上提出有关通用计算硬件和软件的问题。您可以编辑问题,使其成为
我是一名优秀的程序员,十分优秀!