title: Passing an object as a constructor parameter seems to be passing by reference instead of value
body: <p>I'm having strange issue where I am creating a new object which contains a parameter for another object (paramObj) I use through my function. So, paramObj is used in an object constructor, but it ends up being altered after the constructor is called. Since C# is pass by value, I'm not sure why this is happening.</p>
  
  <p>My code:</p>
  
  <pre><code>void MyFunction(List&lt;string&gt; filesets)
  {
      foreach(Fileset fs in filesets)
      {
          //At this point, fs.allFiles.Count is 30. The MyNewObject class
          //takes a Fileset as a parameters and eventually clears the 
          //Fileset.allFiles List, making the count 0.
          MyNewObject tmpObj = new MyNewObject(fs, null, "default");
  
          //At this point, fs.allFiles.Count is 0, but I expect it to be 30
  
      }
  }
  </code></pre>
  
  <p>The <code>MyNewObject</code> class simply clears the <code>allFiles</code> list contained within a <code>Fileset</code> class. Why is that showing up after the constructor if C# is pass by value?</p>