title: Strongly-typed T4MVC Action/ActionLink
body: <p>I've been using <a href="https://github.com/T4MVC/T4MVC" rel="nofollow noreferrer">T4MVC</a> (FYI: v2.6.62) for quite some time, and I've been slowly moving over our code to this way of working (less reliance on <a href="http://en.wikipedia.org/wiki/Magic_string_(programming)" rel="nofollow noreferrer">magic strings</a>).</p>
  
  <p>But I've had to stop because, for some reason, T4MVC is unable to translate objects into urls, and only seems to be able to work on primitive types (int/string/etc).</p>
  
  <p>Here is an example:</p>
  
  <p><strong>Route breakdown:</strong></p>
  
  <pre><code>/MyController/MyAction/{Number}/{SomeText}
  </code></pre>
  
  <p><strong>Class:</strong></p>
  
  <pre><code>namespace MyNamespace
  {
    public class MyClass
    {
      public int Number { get; set; }
      public string SomeText { get; set; }
    }
  }
  </code></pre>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code>public class MyController
  {
    public virtual ActionResult MyAction(MyClass myClass)
    {
      return View();
    }
  }
  </code></pre>
  
  <p><strong>View:</strong></p>
  
  <pre><code>&lt;%= Html.Action(
    T4MVC.MyController.Actions.MyAction(
      new MyClass()
      {
        Number = 1,
        SomeText = "ABC"
      }
   ) %&gt;
  </code></pre>
  
  <p>The end result is this:</p>
  
  <pre><code>/MyController/MyAction?myClass=MyNamespace.MyClass
  </code></pre>
  
  <p>and not</p>
  
  <pre><code>/MyController/MyAction/1/ABC
  </code></pre>
  
  <p>Does anyone else have this problem? Are T4MVC urls like this available?</p>
  
  <p>Question also asked at the <a href="http://forums.asp.net/p/1532611/3714104.aspx" rel="nofollow noreferrer">ASP.NET Forum</a>.</p>