0
這裏是這個問題我的數據庫表: 實體框架選擇收藏
既然我已經選擇了WorkReleaseHeader,我現在想獲得有關WorkOrderDetails名單WorkReleaseHeader。似乎很容易,但我無法做到這一點。我feable嘗試:
List<WorkReleaseDetail> workReleaseDetails =
((IEnumerable<WorkReleaseDetail>)wrkRlsHdr.WorkReleaseDetails).ToList();
List<WorkOrderDetail> workOrderDtlsForWorkRelease =
workReleaseDetails
.Select(wrkDtls => wrkDtls.WorkOrderHeader.WorkOrderDetails).ToList();
結果在錯誤的Select語句行:
Error 3 Cannot implicitly convert type
'System.Collections.Generic.List<System.Collections.Generic.ICollection<WorkOrderDetail>>'
to 'System.Collections.Generic.List<WorkOrderDetail>'
謝謝@FloChanz這樣做! –