title: Adding array of complex types to RouteValueDictionary
body: <p>I was wondering if there is an elegant way to add an array of complex types to a RouteValueDictionary or compatible type?</p>
  
  <p>For example, if I have a class and an action:</p>
  
  <pre><code>public class TestObject
  {
      public string Name { get; set; }
      public int Count { get; set; }
  
      public TestObject()
      {
      }
  
      public TestObject(string name, int count)
      {
          this.Name = name;
          this.Count = count;
      }
  }
  
  public ActionResult Test(ICollection&lt;TestObjects&gt; t)
  {
      return View();
  }
  </code></pre>
  
  <p>then I know that if I call this action via the URL "/Test?t[0].Name=One&amp;t[0].Count=1&amp;t[1].Name=Two&amp;t[1].Count=2" that MVC will map those query string parameters back into the ICollection type automatically. However, if I am manually creating a link somewhere using Url.Action(), and I want to pass a RouteValueDictionary of the parameters, when I add an ICollection to the RouteValueDictionary, Url.Action just renders it as the type, like &amp;t=System.Collections.Generic.List.</p>
  
  <p>For example:</p>
  
  <pre><code>RouteValueDictionary routeValDict = new RouteValueDictionary();
  List&lt;TestObject&gt; testObjects = new List&lt;TestObject&gt;();
  
  testObjects.Add(new TestObject("One", 1));
  testObjects.Add(new TestObject("Two", 2));
  routeValDict.Add("t", testObjects);
  
  // Does not properly create the parameters for the List&lt;TestObject&gt; collection.
  string url = Url.Action("Test", "Test", routeValDict);    
  </code></pre>
  
  <p>Is there any way to get it to automatically render that collection into the format that MVC also understands how to map, or must I do this manually? </p>
  
  <p>What am I missing, why would they make it so this beautiful mapping exists into an Action but not provide a way to manually work in the reverse direction for creating URLs?</p>