0
我装饰我的MVC 5的行动与路径属性:MVC 5 UrlHelper没有HTTPContext?
[Route("this-test")]
public ActionResult ThisTest()
,并用HttpContext的,我可以访问路由名称,像这样:
UrlHelper helper = new UrlHelper(System.Web.HttpContext.Current.Request.RequestContext);
string actionUrl = helper.Action("ThisTest", "Home");
但是我使用的是迟发型代上作业断火一些电子邮件。由于我没有HTTPContext,因此我无法使用上面的代码来获取“home/this-test /”的路线。
这可能实现吗?谢谢。