Hi Guys,

I was trying to make the following function a typed one like a TInfo
and a TData. But ran out of ideas. Can anyone help? Am I trying to do
something that is not possible...at all?

        Private Shared Function AssembleData( _
                  ByVal dataList As List(Of PermissionInfoData) _
                ) As List(Of PermissionInfo)

            Dim permissions As New List(Of PermissionInfo)

            For Each data As PermissionInfoData In dataList
                permissions.Add(New PermissionInfo(data))
            Next

            Return permissions
        End Function

Note that the TInfo class would be having a constructor that takes a
TData to populate itself. This is what I tried:

        Private Shared Function AssembleData(Of TInfo As {Class, New},
TData)( _
                  ByVal dataList As List(Of TData) _
                ) As List(Of TInfo)

            'Return permissions
            Dim infoList As New List(Of TInfo)
            Dim info As New TInfo(TData)

            For Each data As TData In dataList
                infoList.Add(info)
            Next

            Return infoList
        End Function

Thanks.

Reply via email to