title: Pass a dictionary from one function to another function and print it
body: <p>My goal is to pass <code>myDictionary</code> from <code>function1</code> to <code>function2</code> and print it from <code>function2</code>. I am a newbie so it is quite possible my syntax or format is incorrect.</p>
  
  <pre><code>// This is my main program
  class Program
  {
      static void Main(string[] args)
      {
          function1();
      }
  }
  
  // Create myDictionary in this function and then pass it to function2
  static public void function1()
  {
      Dictionary&lt;string, string&gt; myDictionary = new Dictionary&lt;string, string&gt;();
      myDictionary.Add("FirstName", "John");
      myDictionary.Add("LastName", "Walter");
  
      // passing myDictionary to another function
      function2(myDictionary);
  }
  
  // Passing myDictionary to this function
  static public function2(myDictionary&lt;string, string&gt;)
  {
      // print myDictionary from here 
  }
  </code></pre>