title: ASP.Net MVC 4 w/ AttributeRouting and multiple RoutePrefix attributes
body: <h1>TL;DR</h1>
  
  <p>I need a way to programtically choose which RoutePrefix is chosen when generating URLs based on the properties of a user in my MVC app</p>
  
  <h1>Not TL;DR</h1>
  
  <p>I have an MVC 4 app (with the AttributeRouting NuGet package)</p>
  
  <p>Due to the requirements of the hosting environment I have to have two routes for a lot of my actions so that the hosting environment can have different permissions for access.</p>
  
  <p>I am solving this by decorating my controller with with <code>[RoutePrefix("full")]</code> <code>[RoutePrefix("lite)]</code>. which allows each action method to be accessed via /full/{action} and /lite/{action}.</p>
  
  <p>This works perfectly.</p>
  
  <pre class="lang-csharp prettyprint-override"><code>[RoutePrefix("full")]
  [RoutePrefix("lite")]
  public class ResultsController : BaseController
  {
      // Can be accessed via /full/results/your-results and /lite/results/your-results and 
      [Route("results/your-results")]              
      public async Task&lt;ActionResult&gt; All()
      {
      }
  
  }
  </code></pre>
  
  <p>However, each user should only use either full or lite in their urls, which is determined by some properties of that user. </p>
  
  <p>Obviously when I use <code>RedirectToAction()</code> or <code>@Html.ActionLink()</code> it will just choose the first available route and won't keep the "correct" prefix.</p>
  
  <p>I figured I can override the <code>RedirectToAction()</code> method as well as add my own version of <code>@Html.ActionLink()</code> methods. </p>
  
  <p>This will work, but it will involve some nasty code for me to generate the URLs because all I get is a string representing the action and controllers, but not the reflected types.  Also there might be route attributes such as in my example, so I am going to have to replicated a lot of MVCs built in code.</p>
  
  <p>Is there a better solution to the problem I am trying to solve?</p>