title: ASP MVC: how to make url with passing array as parameter by RouteCollection.GetVirtualPath
body: <p>I have a simple model.</p>
  
  <pre><code>class MyModel
  {
      public int id{get;set;}
      public IEnumerable&lt;int&gt; params{get;set;}
  }
  </code></pre>
  
  <p>my action method is declared as:</p>
  
  <pre><code>public ViewResult Index(int id, IEnumerable&lt;long&gt; params)
  </code></pre>
  
  <p>and have a simple code on template with razor engine:</p>
  
  <pre><code> @Html.BuildUrlFromExpression((ShareController c) =&gt; c.Index(Model.id, Model.params));
  </code></pre>
  
  <p>the thing <code>RouteCollection.GetVirtualPath</code> - this method returns an incorrect URL
  as result i have url
  fir example <code>@Url.Action("Index","Default",new {id=1, params = new long[]{11,33}});</code> get some value</p>
  
  <pre><code>/Default/Index/49?params=System.Int64%5B%5D;
  </code></pre>
  
  <p>it seems rather obvious fact that the construction of the address must correctly understand what type it is passed. I would want that the <code>BuildUrlFromExpression</code> gave the correct value.</p>
  
  <pre><code>/Default/Index/49?params=23&amp;params=45
  </code></pre>
  
  <p>I have some work solution:</p>
  
  <pre><code>var rv = new RouteValueDictionary();
  rv.Add("param[0]", 11);
  rv.Add("param[1]", 33);
  rv.Add("id", Model.CurrInFolderNum);
  Url.Action("Index","default",rv)
  </code></pre>
  
  <p>but it works through the transmission of some number of parameters! I wish that would have been transferred to the array.
  I think the answer somewhere on the surface.</p>