title: VB.NET Accessing Class Variables in Dictionary
body: <p>I'm not sure of the syntax necessary to access a class's attributes inside of a Dictionary declaration.</p>
  
  <pre><code>Public food As New Dictionary(Of String, cheese) From
  {
      {"cheese1", New cheese},
      {"cheese2", New cheese},
      {"cheese3", New cheese}
  }
  
  Public Class cheese
      Public info As New Dictionary(Of String, Array) From
      {
          {"attributes1",
              {New Dictionary(Of String, String) From
                  {
                      {"name", "test"},
                      {"taste", vbNullString},
                      {"color", vbNullString}
                  }
              }
          },
          {"attributes2",
              {New Dictionary(Of String, String) From
                  {
                      {"name", "test"},
                      {"taste", vbNullString},
                      {"color", vbNullString}
                  }
              }
          }
      }
  End Class
  </code></pre>
  
  <p>So if I want to test it and use <code>MsgBox()</code> how do I trickle down to pull, say, <code>name</code> in <code>food &gt; cheese1 &gt; info &gt; attributes2 &gt; name</code>?</p>
  
  <p>EDIT:
  I just realized that <code>Array</code> in <code>info</code> needs to be a Dictionary for an associative array, so please ignore that error and just assume it is a Dictionary for this question's sake.</p>