I have two lists declared as follows:
Dim lstDBItems As New List(Of DBItem)
Dim lstAppItems As New List(Of AppItem)
I am trying to do something like this:
I’ve a function which returns List(Of AppItem):
Function GetAppItems() As List(Of AppItem)
'...
End Function
In the above function I populate lstDBItems and then write the return statement like follows:
Return lstDBItems.Select(Function(x)
dim oItem As New AppItem()
oItem.Property1 = x.DbProperty1
'...
Return oItem
End Function)
The weird thing is the code compiles, but on rumtime I get a type case error. What is the correct way of doing what I’m trying to achieve…?
PS: Excuse the screenshot tampering.

Add
ToList()after theSelectto have aList(Of AppItem)as return value