这不起作用,但应该让您了解我想要实现的目标:
public static IEnumerable<T> MyMethod<T>(this IEnumerable<T> entity,
string param, string SomeProp)
{
return entity.Where(l =>
System.Data.Objects.SqlClient.SqlFunctions.PatIndex(param, l.SomeProp) > 0);
}
我是否必须将整个Where()
参数作为函数传递给MyMethod
?