VB.NET:
Public Function GetProduct(ByVal mxID As Integer) As List(Of dtProduct) Implements IService1.GetProduct
Dim dc As New DataContext()
Dim results = From c In dc.dtProducts _
Where c.ProductID < mxID _
Select new with{c.ProductName,c.ProductPrice}
Return results.ToList
End Function
When i use this code it give a squiggly line under .ToList but if i change the linq to
VB.NET:
Public Function GetProduct(ByVal mxID As Integer) As List(Of dtProduct) Implements IService1.GetProduct
Dim dc As New DataContext()
Dim results = From c In dc.dtProducts _
Where c.ProductID < mxID _
Select c
Return results.ToList
End Function
What should I dim the anonymous type as if the output is not a list
Last edited by a moderator: