1、单个条件
//Name是传入的参数值
List<Test> list = new List<Test>(); list = list.Where(a => a.testName.Contains(Name)).ToList();
2、多个条件合并查询
//Number_Name是传入的参数值 List<Test> list = new List<Test>(); list = list.Where(a => a.testNumber.Contains(Number_Name) || a.testName.Contains(Number_Name)).ToList();
//
List<Test> list = new List<Test>();
list = list.Where(a => a.testNumber.Contains(Number_Name) && a.testName.Contains(Number_Name)).ToList();