Asp.net mvc 4 我们可以在控制器中使用Htmlhelper类吗?

Asp.net mvc 4 我们可以在控制器中使用Htmlhelper类吗?,asp.net-mvc-4,asp.net-web-api,Asp.net Mvc 4,Asp.net Web Api,我正在从事web api项目,我们有一个htmlhelper类,其中我看到的声明如下: public static string GetCountryDomain(this System.Web.Mvc.HtmlHelper htmlHelper, Area area) { //body } 我可以在api方法中使用helper类中声明的方法吗? 如果是,那么

我正在从事web api项目,我们有一个htmlhelper类,其中我看到的声明如下:

 public static string GetCountryDomain(this System.Web.Mvc.HtmlHelper htmlHelper, Area area)
                     {
                         //body
                     }
我可以在api方法中使用helper类中声明的方法吗? 如果是,那么有人能解释一下如何从我的控制器调用该方法吗

考虑下面的示例,其中我从我的控制器调用helper中声明的方法

HtmlHelper.GetCountryDomain(area_id);
有人能解释一下为了调用HtmlHelper类的上述方法,我需要传递的第一个参数是什么吗?

您可能需要了解。的可能重复