clientCLID 및 EmailAddress별로 그룹화해야하는 첨부 파일 목록이 있습니다. 이 그룹화 된 목록에서 clientCLID 목록 만 있으면됩니다.vb.net에서 여러 열로 그룹화하는 더 좋은 방법이 있습니까
Dim ClientCLIDs As New List(Of Guid)
Dim groupedAttachments = attachments.GroupBy(Function(j) New With {Key j.ClientCLID, Key j.EmailAddress}).Select(Function(group) New With {Key .compKey = group.Key.ClientCLID}).ToList()
For Each attachment In groupedAttachments
Dim clientGuid As Guid = New Guid(attachment.compKey.ToString())
ClientCLIDs.Add(clientGuid)
Next
이 작업을 수행 할 수있는 더 나은/청소기/쉬운 방법이 있나요 다음과 같이
잠시 동안 바이올린을 켜는 후 나는 일하러 가야 관리했습니다? 구문에 의한 vb 그룹은 지저분합니다!
편집
난 그냥 ... 다음 예) (별개의 봅니까 어차피 :
ClientGuid EmailAddress
A [email protected]
A [email protected]
A [email protected]
: 나는 3 번 최종 목록에 표시 클라이언트 A를 필요 여기
을
여기에서는 클라이언트 A가 최종 목록에 한 번만 표시되기를 원합니다.
ClientGuid EmailAddress
A [email protected]
A [email protected]
A [email protected]
을 그래서 당신이 원하는 모든이의 목록입니다 명백한'attachment.ClientCLID's? – AakashM
@AakashM 사과 - 아니 그게 내가 뭘 필요하지 않습니다 위의 편집 참조하십시오 – woggles