So say I have a collection of Bloops
Class Bloop
Public FirstName
Public LastName
Public Address
Public Number
Public OtherStuff
End Class
<
This should do the job:
Dim results = From item In bloops _
Select New Razzie() With _
{ _
.FirstName = item.FirstName, _
.LastName = item.LastName _
}
And if you want to convert the result from IEnumerable
(what the LINQ query returns) to an array or List
, just append a call to the ToArray()
or ToList()
extension methods respectively.
Edit: Corrected the code so that it now has valid VB.NET 9 syntax.