我很难过.我需要帮助.我有一个带有重复患者地址数据的DTO对象.我只需要获得唯一的地址.
Dim PatientAddressDto = New List(Of PatientAddress)
{Populate PatientAddressDto with lots of duplicate data}
PatientAddressDto = (From d In PatientAddressDto
Group d By PatientAddressDtoGrouped = New PatientAddress With {
.Address1 = d.Address1,
.Address2 = d.Address2,
.City = d.City,
.State = d.State,
.Zip = d.Zip
}
Into Group
Select New PatientAddress With {
.Address1 = PatientAddressDtoGrouped.Address1,
.Address2 = PatientAddressDtoGrouped.Address2,
.City = PatientAddressDtoGrouped.City,
.State = PatientAddressDtoGrouped.State,
.Zip = PatientAddressDtoGrouped.Zip
}).ToList()
Run Code Online (Sandbox Code Playgroud)
我试过以下没有运气:
PatientAddressDto = (From d In PatientAddressDto
Select New PatientAddress With { …Run Code Online (Sandbox Code Playgroud)