2
問候我有一個邏輯問題,我有2個程序結合2個LINQ操作
首先是LINQ,看起來像:
_sharedDocumentsAttachments = SourceDocumentAttachmentMeta
.Where(sDoc => TargetDocumentAttachmentMeta.Any(tDoc => tDoc.DocumentBridgeId == sDoc.DocumentId)).ToList();
凡
List<DocumentAttachment> _sharedDocumentsAttachments;
而且
SharedDocumnentAttachmentConnector = new Dictionary<int, int>();
foreach (DocumentAttachment document in _sharedDocumentsAttachments)
{
foreach (DocumentAttachment tDoc in TargetDocumentAttachmentMeta.Where(tDoc => document.DocumentId == tDoc.DocumentBridgeId))
{
SharedDocumnentAttachmentConnector.Add(document.DocumentId, tDoc.DocumentId);
}
}
而我很好奇g如果我可以以某種方式將第二個過程附加到第一個過程,因爲基本上它們正在做相同的比較,但將值添加到2個不同的集合中?
我正在試驗每個,但它不會正常工作。