title: Custom Class of property added to a List
body: <p>This seems like something I should know, and maybe it's working fine but it looks wrong to me.  I'm looking to add some data from a database query into a list which I've created a custom class of properties to hold.  </p>
  
  <p>My class:</p>
  
  <pre><code>Public Class MyClass
      Private _Col1 As String
      Private _Col2 As String
      Private _Col3(,) As Object
      Private _Col4 As String
  
      Public Property Col1() As String
          Get
              Return _Col1
          End Get
          Set(ByVal value As String)
              _Col1 = value
          End Set
      End Property
  
      Public Property Col2() As String
          Get
              Return Col2
          End Get
          Set(ByVal value As String)
              Col2= value
          End Set
      End Property
  
      Public Property Col3() As Object(,)
          Get
              Return Col3
          End Get
          Set(ByVal value As Object(,))
              Col3= value
          End Set
      End Property
  
      Public Property Col4() As String
          Get
              Return Col4
          End Get
          Set(ByVal value As String)
              _Col4= value
          End Set
      End Property
  
      Sub New(ByVal col1 As String, ByVal col2 As String, ByVal col3 As Object, ByVal col4 As String)
          _Col1= col1
          _Col2= col2
          _Col3 = col3
          _Col4 = col4
  
      End Sub
  
   End Class
  </code></pre>
  
  <p>When I declare and initialize my List(of Class) and then add data to it:</p>
  
  <pre><code>Dim NList as New List(Of MyClass)
  
  NList.Add(New MyClass("1", "2", (1,3), "3"))
  </code></pre>
  
  <p>When I take a look at the List item, I am seeing 8 items inside the list instead of 4. 4 are the methods in there, and 4 are the variables.  Is this correct and how class properties act?  It seems like I am wasting resources by adding data to the 4 variables and if I have to loop through a recordset that has 40k rows I am assuming it would add to performance.  Is this the correct way it works?  I plan on adding items to the list and using the Find() function later in the program so I feel that 8 items instead of 4 is un needed.</p>
  
  <p>Edit: The list items</p>
  
  <pre><code>?NList.Item(0)
      _Col1: "1" {String}
      _Col2: "2"
      _Col3: "(1,3)"
      _Col4: "4"
      Col3: "(1,3)"
      Col4: "4"
      Col1: "1"
      Col2: "2"
  </code></pre>