3

public static class EmptyOrNullHelper

public static string EmptyOrNull(this HtmlHelper helper, IQueryable(T) type)
{
//Code
}

}

4

1 回答 1

3

像这样:

public static class EmptyOrNullHelper
{

    public static string EmptyOrNull<T>(this HtmlHelper helper, IQueryable<T> type)
    {
        //Code
    }

}

换句话说,为要在其参数之一中使用的方法指定通用参数。您不需要在正常调用方法的地方执行此操作,只需在声明中即可。

于 2010-06-01T10:53:16.237 回答