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).
So that instead of writing something like this:
RedirectToAction("Detail",
new RouteValueDictionary { {"messageId", messageId}});
I would do like this:
this.RedirectToAction(x => x.Detail(messageId));
I tried and did something like this but I don't know how to add the parameters:
public static RedirectToRouteResult RedirectToAction<T>(this T controller,
Expression<Action<T>> expression)
{
return RedirectToAction(
(expression.Body as MethodCallExpression).Method.Name
);
}