T4MVC和没有查询参数的路径

时间:2012-04-10 23:07:47

标签: t4mvc

我可以使用T4MVC渲染没有查询参数的网址而不使用可空的整数吗?

public virtual ActionResult GetSchoolsForDistrict(int districtId)
        {
            return Json(_schoolsService.GetSchoolsByDistrict(districtId.Value), JsonRequestBehavior.AllowGet);
        }

1 个答案:

答案 0 :(得分:2)

你应该能够在没有任何参数的情况下调用它。 e.g。

Html.ActionLink(MVC.Schools.GetSchoolsForDistrict())

这是因为T4MVC总是生成没有参数的重载。

相关问题