title: Passing a list parameter as ref
body: <p>What is the advantage of passing a list as parameter as ref in C#?
  List is not a value type so every changes done on it will reflect after returning the function.</p>
  
  <pre><code>class Program
  {
      static void Main(string[] args)
      {
          var myClass = new MyClass();
          var list = new List&lt;string&gt;();
          myClass.Foo(ref list);
  
          foreach (var item in list)
          {
              Console.WriteLine(item);
          }
      }
  }
  
  class MyClass
  {
      public void Foo(ref List&lt;string&gt; myList)
      {
          myList.Add("a");
          myList.Add("b");
          myList.Add("c");
      }
  }
  </code></pre>
  
  <p>I can remove "ref" and it will work fine.
  So my question is for what usage do we need to add ref keyword for lists, arrays...
  Thanks</p>