110,566
社区成员
发帖
与我相关
我的任务
分享
someList.where(c=>(c.Name??"").contains("someName"))
//加个判断试试
if(!string.IsNullOrEmpty(someName))
{
someList.where(c=>(c.Name??"").contains("someName")) }
static void Where(Expression<Func<string, Boolean>> act)
{
List<string> list = new List<string>();
list.Where<string>(act.Compile());
}
static void Main(string[] args)
{
Where(name => null == name ? false : name == "someName");
}