H
hardieca
Hi,
I have a list of sections that contain a parent section ID field that
indicates hierarchy throughout a website. I want to filter out all non-
root level sections, as indicated by a section ID of -1, so I tried
using the findall method.
Dim rootSectionList As New SectionList()
rootSectionList = mySectionList.FindAll(AddressOf isRootSection)
Which in turn calls:
Private Shared Function isRootSection(ByVal sec As Section) As Boolean
If sec.SectionID < 0 Then
Return True
Else
Return False
End If
End Function
I am getting the error: Unable to cast object of type
System.Collections.Generic.List`1[Deais.Pps.BO.Section]' to type
'Deais.Pps.BO.SectionList'.
Does anyone have any ideas what I'm doing wrong?
Thanks,
Chris
I have a list of sections that contain a parent section ID field that
indicates hierarchy throughout a website. I want to filter out all non-
root level sections, as indicated by a section ID of -1, so I tried
using the findall method.
Dim rootSectionList As New SectionList()
rootSectionList = mySectionList.FindAll(AddressOf isRootSection)
Which in turn calls:
Private Shared Function isRootSection(ByVal sec As Section) As Boolean
If sec.SectionID < 0 Then
Return True
Else
Return False
End If
End Function
I am getting the error: Unable to cast object of type
System.Collections.Generic.List`1[Deais.Pps.BO.Section]' to type
'Deais.Pps.BO.SectionList'.
Does anyone have any ideas what I'm doing wrong?
Thanks,
Chris