dimanche 1 juin 2014

Casting Anonymous Type LINQ Using TryCast Returns Nothing


Vote count:

0




I want my query to return a List (Of Service) then I want to use the new list to further filter.


When I run this query it exectutes correctly Dim duplicateService = svgGrpContainer.GroupBy(Function(x) x.ServiceGroup).Where(Function(x) x.Count > 1).Select(Function(x) x)


I am now attempting to cast it in oder to use it and create another query



Dim duplicatePAK = duplicateServiceGroups.GroupBy(Function(x) x.Name).Where(Function(x) x.Count > 1).Select(Function(x) x)


When I cast the first query it now returns Nothing



Dim duplicateServiceGroups As List(Of ServiceGroup) = TryCast(svgGrpContainer.GroupBy(Function(x) x.ServiceGroup).Where(Function(x) x.Count > 1).Select(Function(x) x), List(Of ServiceGroup))


How do I cast the query so I can further filter the data in subsequent queries?



asked 22 secs ago






Aucun commentaire:

Enregistrer un commentaire