title: asp.net mvc: make RedirectToAction(string, object) into RedirectToAction<Controller>(x => x.Detail(id))
body: <p>anybody knows how to make a method (I will put it in a extensions class) that will do the same as the mvc's RedirectToAction only using expressions (no magic strings).</p>
  
  <p>So that instead of writing something like this:</p>
  
  <pre><code> RedirectToAction("Detail", 
      new RouteValueDictionary { {"messageId", messageId}});
  </code></pre>
  
  <p>I would do like this:</p>
  
  <pre><code>this.RedirectToAction(x =&gt; x.Detail(messageId));
  </code></pre>
  
  <p>I tried and did something like this but I don't know how to add the parameters:</p>
  
  <pre><code> public static RedirectToRouteResult RedirectToAction&lt;T&gt;(this T controller,
       Expression&lt;Action&lt;T&gt;&gt; expression)
   {
       return RedirectToAction(
          (expression.Body as MethodCallExpression).Method.Name
       );
   }
  </code></pre>