title: Implement same logic for diffrent objects as T
body: <p>I suppose to use T but i am not sure how do it in proper way.</p>
  
  <p>Let's consider following example.</p>
  
  <p>Base class:</p>
  
  <pre><code>Public Class HtmlBase
              Implements IGetInformation
  
     Public Overridable Function IsExist() As Boolean Implements IGetInformation.IsExist
             Throw New NotImplementedException()
     End Function
  
     Public Overridable Function GetIdByName(pName As String) As Integer Implements IGetInformation.GetIdByName
          Throw New NotImplementedException()
     End Function
  
  End Class
  </code></pre>
  
  <p>Example classes which inherit from base class:</p>
  
  <pre><code>Public Class HtmlSubSection
        Inherits HtmlBase
  
  '--sometimes i have to overload to add additioinal parameter
  Public Overloads Function isExist(subsection As String) As Boolean
        Dim dlsubkategorie As New DataLayer.DALSubSection
        Return dlsubkategorie.CheckIfSubSectionExist(subsection)
  End Function
  
  Public Overrides Function GetIdByName(subsectionName As String) As Integer
        Dim dlget As New DataLayer.DALSubSection
        Return dlget.GetSubSectionIdByName(subsectionName)
  End Function
  
  End Class
  
  
  Public Class HtmlSection
       Inherits HtmlBase
  
      'sometime i have to overload to add additioinal parameter
  
  Public Overloads Function IsExist(section As String) As Boolean
       Dim dlsubkategorie As New DataLayer.DALSection
       Return dlsubkategorie.CheckIfSectionExist(section)
  End Function
  
  Public Overrides Function GetIdByName(Name As String) As Integer
        Dim dlsubkategorie As New DataLayer.DALSection
        Return dlsubkategorie.GetSectionIdByName(Name)
        End Function
  End Class
  </code></pre>
  
  <p>As could be seen above two classes which inherits from base within their methods has same logic (sometimes i have to use additional parameter therefore overloads there, but are using diffrent DAL class to call. I would like to implement this logic in base class and for each just point to specific DAL. How to do that to not everytime in those classes write e.g:</p>
  
  <pre><code>Dim dlsubkategorie As New DataLayer.&lt;DALSection&gt;
  Return dlsubkategorie.GetSectionIdByName(Name)
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Htmlbase constructor's:</p>
  
  <pre><code> Sub New()
      End Sub
  
      Sub New(pId As Integer)
          _Id = pId
      End Sub
  </code></pre>
  
  <p>HtmlSubSection's constructors:</p>
  
  <pre><code> Sub New()
          MyBase.New()
          AvailableSentences = New List(Of HtmlSubSection_Sentence)
          SelectedSentences = New List(Of HtmlSubSection_Sentence)
      End Sub
      Sub New(pId As Integer)
          MyBase.New(pId)
      End Sub
      Sub New(pName As String)
          _Name = pName
      End Sub
  
      Sub New(pId As Integer, pName As String)
          MyBase.New(pId)
          _Name = pName
      End Sub
  </code></pre>
  
  <p>HtmlSection's constructors:</p>
  
  <pre><code>Sub New()
          MyBase.New()
      End Sub
  
      Sub New(pId As Integer)
          MyBase.New(pId)
      End Sub
      Sub New(pId As Integer, pName As String, pPosition As Integer)
          MyBase.New(pId)
          _Name = pName
          _Position = pPosition
      End Sub
  
      Sub New(pName As String)
          _Name = pName
      End Sub
  
      Sub New(pName As String, pPosition As Integer)
          _Name = pName
          _Position = pPosition
      End Sub
  </code></pre>