为什么我得到错误“预期类,接口,枚举或结构”用绳子下划线?

 public static string IsSelected(this HtmlHelper helper, string A, string B)

    {
         return "wtf";

    }
有帮助吗?

解决方案

您扩展方法必须是一个静态类内:

public static class MyExtensions
{
    public static string IsSelected( this HtmlHelper helper, string A, string B)
    {
        return "wtf";

    }
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top