我有这样的方法:
public static void Fill<T> (this DropDownList control,
Expression<Func<T, object>> value,
Expression<Func<T, bool>> whereClause = null,
Expression<Func<T, object>> orderClause = null,
string selectedvalue = null) where T : class
{}
到目前为止一切顺利......但我需要在 Where 和 Order 子句中添加 List 选项,所以我添加了更多 3 个新方法:
public static void Fill<T> (this DropDownList control,
Expression<Func<T, object>> value,
IList<Expression<Func<T, bool>>> listWhereClause = null,
IList<Expression<Func<T, object>>> listOrderClause = null,
string selectedvalue = null) where T : class
{}
public static void Fill<T> (this DropDownList control,
Expression<Func<T, object>> value,
IList<Expression<Func<T, bool>>> listWhereClause = null,
Expression<Func<T, object>>> orderClause = null,
string selectedvalue = null) where T : class
{}
public static void Fill<T> (this DropDownList control,
Expression<Func<T, object>> value,
Expression<Func<T, bool>>> whereClause = null,
IList<Expression<Func<T, object>>> listOrderClause = null,
string selectedvalue = null) where T : class
{}
现在的问题是我得到了不明确的调用错误......解决这个问题的最佳选择是什么(不增加方法计数)?