JRockFL
asked on
Linq and List
Does this look correct? I'm not getting any compiler errors, but I wanted a second set of eyes to look at it.
Is there another way of doing this without the CType ?
Is there another way of doing this without the CType ?
Public Shared Function GetTop5ThisMonth() As List(Of Entities.PromoCodeUsuage)
Dim startDate As New DateTime(Date.Now.Year, Date.Now.Month, 1)
Dim endDate As DateTime = startDate.AddMonths(1)
Dim list As List(Of Entities.PromoCodeUsuage) = BusinessObjects.PromoCodeUsuage.List(startDate, endDate)
Return CType((From l In list Order By l.Total Descending Select l).Take(5), List(Of Entities.PromoCodeUsuage))
End Function
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You are Most Welcome
ASKER