1. /// <summary> 
  2.         /// 按条件查询产品 
  3.         /// </summary> 
  4.         /// <param name="name"></param> 
  5.         /// <param name="type"></param> 
  6.         /// <param name="batch"></param> 
  7.         /// <returns></returns> 
  8.         public static List<product> SelectPro(string name, string type, string batch) 
  9.         {             
  10.             Expression<Func<product, bool>> expr1 = (name == "0") ? DynamicLinqExpressions.True<product>() : (p => p.prod_name.Contains(name)); 
  11.             Expression<Func<product, bool>> expr2 = (type == "0") ? DynamicLinqExpressions.True<product>() : (p => p.prod_type.Contains(type)); 
  12.             Expression<Func<product, bool>> expr3 = (batch == "0") ? DynamicLinqExpressions.True<product>() : (p => p.prod_batch.Contains(batch)); 
  13.  
  14.             List<product> result = DBHelper222.Context.product.Where<product>(DynamicLinqExpressions.And((DynamicLinqExpressions.And(expr1, expr2)),expr3).Compile()).ToList(); 
  15.  
  16.             return result; 
  17.         }