我有這麼一個需求,
public List query_銷售票(List 條件List)
{
using (var db = new ERPDBDataContext())
{
var linq = from p in db.rec_Piao_Out
join c in db.doc_Customer on p.顧客ID equals c.顧客ID into c1
from cdefault in c1.DefaultIfEmpty()
select p;
return linq.ToList();
}
}
我怎麼將條件list添加到linq where 之中呢。list是一個條件集合.
return linq.AsEnumerable()
.Where(x => 條件List.Select(y => y.主鍵).Contains(x.主鍵))
.ToList();