I'm creating a class that will wrap around a Collections.Generic.List object so that I don't have to keep writing the same wrapper functions in all classes that use a List and can just make the variable public. While the code I've got below works, it means that the returned object from the getItem method will always need casting - kind of ruins the point a bit as that just creates as much code. Is there something I can do, maybe some sort of compile trickery to allow the getItem method return the type that it natively is? I've also unsuccessfully tried changing the declaration of List so that the type can be defined also in hopes of making it easier... No such luck.
Any help would be nice.
Public Class CList
Private localList As List(Of Object)
Public Function getItem(ByVal aIndex As Integer) As Object
getItem = localList.Item(aIndex)