Hi,
Sorry if this is obvious but I can't figure this out.
I am using the two classes generated code and have an entity object declared like this in a TblRevisionEntity.vb
Public Class TblRevisionEntity Inherits EntityBase2
'Code not shown
End Class
Else where I have a property which refers to the collection of these entities
Public ReadOnly Property Revisions() As EntityCollection(Of TblRevisionEntity)
Get
Return (Me.mRevisions)
End Get
End Property
My question is why does this cast of Revisions to either one of these collections not work?
Dim collectionA As EntityCollectionBase2(Of EntityBase2)
Dim collectionB As EntityCollection(Of EntityBase2)
collectionA = Revisions
collectionB = Revisions
'OR
collectionA = CType(Revisions,EntityCollectionBase2(Of EntityBase2))
collectionB = CType(Revisions,EntityCollection(Of EntityBase2)
Both the above fail, with or without casting using ctype. If TblRevisionEntity inherits from EntityBase2 why won't the collection cast?
Thank you for your help here.