title: Are ILists passed by value?
body: <p>Passing <a href="http://msdn.microsoft.com/en-us/library/s1ax56ch.aspx" rel="noreferrer">Value Type</a> parameters to functions in c# is by value unless you use the ref or out keyword on the parameter. But does this also apply to <a href="http://msdn.microsoft.com/en-us/library/490f96s2.aspx" rel="noreferrer">Reference Types</a>? </p>
  
  <p>Specifically I have a function that takes an <code>IList&lt;Foo&gt;</code>. Will the list passed to my function be a copy of the list with copy of its contained objects? Or will modifications to the list also apply for the caller? If so - Is there a clever way I can go about passing a copy? </p>
  
  <pre><code>public void SomeFunction()
  {
      IList&lt;Foo&gt; list = new List&lt;Foo&gt;();
      list.Add(new Foo()); 
      DoSomethingWithCopyOfTheList(list);
      ..
  }
  
  public void DoSomethingWithCopyOfTheList(IList&lt;Foo&gt; list)
  {
      // Do something
  }
  </code></pre>