I need the specific code for VB.Net 2.0 - 3.5 to create a BindingList base (abstract) class for my business object 'collections' to inherit from (specifically the 'Persons' below).
The reason I need a base class is that I want to insert some common functionality in it that I do not wish to hand-duplicate in each specific business class and let the power of inheritance do that work.
I have done this sucessfully in the past with .Net 1.1 projects using Collection, but now using BindingList(Of T) with .Net 3.5, which is new to me, it's got me tripped up how not to have to specify the type in the (Of T) of the base class so that I can inherit from it for many different classes in my project and specify the type in each class.
Below is code for example purposeses. I need a base class that clsPersons would inherit from.
'''' Object '''''
Public Class clsPerson
Private _Id As Integer
Private _Name As String
Public ReadOnly Property Id() As Integer
Public Property Name() As String
Set(ByVal value As String)
_Name = value
Public Sub New(ByVal Name As String, ByVal Id As Integer)
_Id = Id
_Name = Name
'''' Collection ''''
Public Class clsPersons
'How to make this non-type specific for inheritance?
Inherits BindingList(Of clsPerson)