Linq 多件拼接

var q = from n in CC_
select n;
if (keys=="none")
{
q = q.Where(p => p.sales_account==sales);
}
if (keys1 != "")
{
q = q.Where(p => p.customer_name.Contains(keys1) || p.customer_code.Contains(keys1));
}

原文地址:https://www.cnblogs.com/peterdys/p/2731507.html