T4MVC is really something here, but it needs to be easily added. Try the following. In T4MVC.tt, change:
public static string Action(this UrlHelper urlHelper, ActionResult result) { return urlHelper.RouteUrl(result.GetRouteValueDictionary()); }
to
public static string Action(this UrlHelper urlHelper, ActionResult result, string protocol = null, string hostName = null) { return urlHelper.RouteUrl(null, result.GetRouteValueDictionary(), protocol, hostName); }
This will allow you to write:
@Url.Action(MVC.Account.LoginYoutube().AddRouteValue("returnUrl", Request.QueryString["ReturnUrl"]), "http")
Please let me know how this works, so we can decide if this should be changed in the official template.
source share